navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

html form to acess database via asp

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> html form to acess database via asp
Page: [1]
 
1220a

 

Posts: 4
Joined: 5/21/2004
Status: offline

 
html form to acess database via asp - 5/21/2004 19:54:14   
pls help:
code in question:

<%
Dim FirstName, LastName, Company, Telephone, Email, Business, Service, Pages, Length, Message
Dim Conn
Dim SQL

If request("insrow") = "1" THEN
FirstName = request("FirstName")
LastName = request("LastName")
Company = request("Company")
Telephone = request("Telephone")
Email = request("Email")
Business = request("Business")
Service = request("Service")
Pages = request("Pages")
Length = request("Length")
Message = request("Message")

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("<%
Dim FirstName, LastName, Company, Telephone, Email, Business, Service, Pages, Length, Message
Dim Conn
Dim SQL



SQL = "INSERT INTO tblQuote (FirstName, LastName, Company, Telephone, Email, Business, Services, Pages, Length, Message) VALUES(" & FirstName & ", " & LastName & ", '" & Company & "', " & Telephone & ", " & Email & ", " & Business & ", " & Service & ", " & Pages & ", " & Length & ", " & Message & ")"

'Response.Write("SQL statement is " & SQL)
'Response.End()
Conn.Execute (SQL)

Conn.Close
Set Conn = Nothing
response.write("<p>Your message has been sent!</p>")
End If

%>"




returns:
Microsoft JET Database Engine error '80040e14'

Syntax error in INSERT INTO statement.

/_contact/thankyou.asp, line 193

here is the statement:

INSERT INTO tblQuote (FirstName, LastName, Company, Telephone, Email, Business, Services, Pages, Length, Message) VALUES(s, s, s, s, s, s, , , , )

I could use some help
pls
thx in advance

< Message edited by 1220a -- 5/21/2004 19:57:26 >
Spooky

 

Posts: 26599
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: html form to acess database via asp - 5/21/2004 20:29:18   
The expected input for a text field is 'value' (with quotes)

SQL = "INSERT INTO tblQuote (FirstName, LastName, Company, Telephone, Email, Business, Services, Pages, Length, Message) VALUES('" & FirstName & "','" & LastName & "','" & Company & "','" & Telephone & "','" & Email & "','" & Business & "','" & Service & "', '" & Pages & "','" & Length & "', '" & Message & "')"

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to 1220a)
1220a

 

Posts: 4
Joined: 5/21/2004
Status: offline

 
RE: html form to acess database via asp - 5/21/2004 20:53:40   
SQL = "INSERT INTO tblQuote (FirstName, LastName, Company, Telephone, Email, Business, Services, Pages, Length, Message) VALUES('" & FirstName & "','" & LastName & "','" & Company & "','" & Telephone & "','" & Email & "','" & Business & "','" & Service & "', '" & Pages & "','" & Length & "', '" & Message & "')"


when i serve this up it returns

Microsoft JET Database Engine error '80040e37'

Could not find output table 'tblQuote'.

/_contact/thankyou.asp, line 193

any ideas

thankyou

(in reply to Spooky)
1220a

 

Posts: 4
Joined: 5/21/2004
Status: offline

 
RE: html form to acess database via asp - 5/21/2004 20:57:30   
SQL = "INSERT INTO tblQuote (FirstName, LastName, Company, Telephone, Email, Business, Services, Pages, Length, Message) VALUES(" & FirstName & ", " & LastName & ", '" & Company & "', " & Telephone & ", " & Email & ", " & Business & ", " & Service & ", " & Pages & ", " & Length & ", " & Message & ")"

if
i take out tbl

it returns

Microsoft JET Database Engine error '80040e07'

Data type mismatch in criteria expression.

/_contact/thankyou.asp, line 193

(in reply to 1220a)
1220a

 

Posts: 4
Joined: 5/21/2004
Status: offline

 
RE: html form to acess database via asp - 5/21/2004 21:04:16   
don't know if this comes into play though i have another feild in the database which QuoteID and auto number...
Not sure if this would come into play.

thx

(in reply to 1220a)
BeTheBall

 

Posts: 6359
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: html form to acess database via asp - 5/21/2004 21:24:37   
So what is the name of the table in the database? Is it tblQuote or Quote?

Assuming the table name is Quote and all the field values are datatype text, then this should work:

SQL = "INSERT INTO Quote (FirstName, LastName, Company, Telephone, Email, Business, Services, Pages, Length, Message) VALUES('" & FirstName & "','" & LastName & "','" & Company & "','" & Telephone & "','" & Email & "','" & Business & "','" & Service & "', '" & Pages & "','" & Length & "', '" & Message & "')"

If any of the these field are numeric, then delete the single quotes. For example, if Length is a numeric field in your db, then '" & Length & "' becomes " & Length & "

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to 1220a)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> html form to acess database via asp
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts