|
|
 |
| Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Databases section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

June 10th, 2004, 12:33 AM
|
|
Registered User
|
|
Join Date: Jun 2004
Location: Savannah, TN, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Syntax error in INSERT INTO statement.
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
/signupconf.asp, line 9
Here's the code up to the point that error occurs. (Red marks are my edits for this post)
<%
dim oConn
dim oRs
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)}"
oConn.ConnectionString = oConn.ConnectionString & ";DBQ=" & server.MapPath("login.mdb")
oConn.Open
line 9 -> set oRs = oConn.Execute("INSERT INTO tblLoginInfo(usrnm,psswrd,rlnm,eml,qstn,answr) VALUES('" & request.Form("usrnm") & "','" & request.Form("psswrd") & "','" & request.Form("rlnm") & "','" & request.Form("eml") & "','" & request.Form("qstn") & "','" & request.Form("answr") & "'")
%>
As you can see, it's pretty standard stuff...although perhaps not standard enough...stupid syntax error. I've condensed down the field names in the Access database and in my form to try and avoid any reserved words. I've also tried replacing all the request.Form statements with static values for testing purposes, but that didn't seem to work either. I've been searching forums for hours and can't seem to come up with a solution. Any ideas?
Andrew Skaggs
__________________
Andrew Skaggs
|

June 10th, 2004, 12:38 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,477
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Andrew
Try this.
Code:
strSQL = "INSERT INTO tblLoginInfo(usrnm,psswrd,rlnm,eml,qstn,answr) VALUES('" & request.Form("usrnm") & "','" & request.Form("psswrd") & "','" & request.Form("rlnm") & "','" & request.Form("eml") & "','" & request.Form("qstn") & "','" & request.Form("answr") & "'"
response.write strSQL
response.end
'''set oRs = oConn.Execute(strSQL)
Then execute output of the above response.write in your DB directly, and see what is missing. Should be some missing QUOTE error.
Hope that helps.
Cheers!
_________________________
-Vijay G
 Strive for Perfection 
|

June 10th, 2004, 12:56 AM
|
|
Registered User
|
|
Join Date: Jun 2004
Location: Savannah, TN, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Well, I'm getting there... I missed a parenthesis. I needed one right before the last double quotes. Now...on to the next error. :)
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
Line 14 is the same code that was line 9 (I added your suggested debugging code above and just commented it out) with the addition of the parenthesis.
set oRs = oConn.Execute("INSERT INTO tblLoginInfo(usrnm,psswrd,rlnm,eml,qstn,answr) VALUES('" & request.Form("usrnm") & "','" & request.Form("psswrd") & "','" & request.Form("rlnm") & "','" & request.Form("eml") & "','" & request.Form("qstn") & "','" & request.Form("answr") & "')")
Thanks already for your help.
Andrew Skaggs
|

June 10th, 2004, 01:14 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,477
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The "IUSR_your_machine" has not enough permissions to write into your database. IUSR privileges must be set to "read/write".
That will solve this.
Cheers!
_________________________
-Vijay G
 Strive for Perfection 
|

June 10th, 2004, 01:18 AM
|
|
Registered User
|
|
Join Date: Jun 2004
Location: Savannah, TN, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Yeah, thanks a bunch! I had just figured that out and got one more issue worked out and everything seems to be working beautifully now.
*pant* Time to get some sleep...it's 12:18 AM... Man, I love programming. :)
Again, thanks a ton.
Andrew Skaggs
|

June 10th, 2004, 01:21 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,477
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Great!
Good night then. Have a sound sleep;)
_________________________
-Vijay G
 Strive for Perfection 
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |