|
| |
|
|
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 §þ k¥
|
|
|
|
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
|
|
|
|
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
|
|
|
|
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
|
|
|
|
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.
|
|
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
|
|
|