Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello, i get this error when i want

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello, i get this error when i want to execute the output. And i don't know what happen. Below is the error:



Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'option'.

/testing.asp, line 41


And my code is as following:


<%

if (Request.Form (&quot;submit&quot;) <> &quot;&quot;) Then

Dim DataConn ' ADO connection object
Dim RsPerson, ConnString, sqlstr
Dim myName, myUserID, myPwd, myDept, myYr, mySem, SQL, myOpt
Dim myMod


myName = Request.Form (&quot;text1&quot;)
myUserID = Request.Form (&quot;text2&quot;)
myPwd = Request.Form (&quot;password1&quot;)
' myConPWD= Request.form(&quot;password1&quot;)
myDept = Request.Form (&quot;menu1&quot;)
myYr = Request.Form (&quot;select3&quot;)
mySem = Request.Form (&quot;select4&quot;)
myOpt = Request.Form (&quot;select2&quot;)
myMod = Request.Form (&quot;checkbox&quot;)


Set DataConn = Server.CreateObject(&quot;ADODB.Connection&quot;)
ConnString=&quot;driver={sql server};server=o6f2e1; database=user;DSN=localserver;PWD=;UID=sa;&quot;

DataConn.Open ConnString

SQL = &quot;INSERT INTO info (NameID, UserID, password, Department, option, yearinfo, Semester) VALUES ('&quot; & myName & &quot;', '&quot; & myUserID & &quot;', '&quot; & myPwd & &quot;', '&quot; & myDept & &quot;','&quot; & myOpt & &quot;', '&quot; & myYr & &quot;', '&quot; & mySem & &quot;');&quot;

line 41 DataConn.Execute (SQL)

SQL = &quot;INSERT INTO Course (UserID, Module, Department) VALUES('&quot; & myUserID & &quot;','&quot; & myMod & &quot;','&quot; & myCou & &quot;');&quot;

DataConn.Execute (SQL)

DataConn.Close
Set DataConn=nothing

Response.Redirect (&quot;hello.asp&quot;)

else%>
<script>
window.alert(&quot;Please re-enter password again&quot;)
</script>

<%End if%>


Can help me take a looK ..........

Thanks... :^)
 
Write SQL to the page and have a look - you will be able to see the problem then.

It almost sounds like option is a reserved keyword, but it's not one I have heard of. The only thing I can suggest is to try a diferent name for the field?
 
Try changing option to [option] (in the SQL statement string).
codestorm
Fire bad. Tree pretty. - Buffy
Hey, I'm operating on a limited mental budget here.
<insert witticism here>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top