Hello,
I am a newbie in ASP, I am trying to list a specific record and update it from the db table. But I keep getting this error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near '='.
student_edit.asp, line 105
Thanks for your help.
Here is my code:
<%
function fixStr( theString )
fixStr = replace( theString, "'", "''")
end function
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open strConnect
%>
<%
sqlString = "select * from jenny where ID =" & ID
Student name: <input type="text" name="name" value="<%=Student_name%>"><br />
Country: <input type="text" name="country" value="<%=country%>"><br />
Phone: <input type="text" name="phone" value="<%=phone%>"><br />
Email: <input type="text" name="email" value="<%=email%>"><br />
<%
sqlString = "update jenny set " &_
"Student name ='" & fixStr( Student_name ) & "', " &_
"Country ='" & fixStr( Country ) & "', " &_
"Phone ='" & fixStr( Phone ) & "', " &_
"Email ='" & fixStr( Email ) & "' where ID =" & ID
dbCon.Execute sqlString
%>
http://www.asiafuns.com/asian_friends/