If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Syntax error in UPDATE statement.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-30-06, 01:40
irisclaire irisclaire is offline
Registered User
 
Join Date: Jan 2006
Posts: 10
Syntax error in UPDATE statement.

i want to update my record but theres an error....

Syntax error in UPDATE statement. line 11. the code is

<%

MsgNo=request.querystring("MsgNo")

set con = server.createobject("ADODB.Connection")
scon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(".././dbase/thesis.mdb") & ";"
con.open scon
a= Trim(request("passcode"))

sql= "update tblOJTStud set Password= '"&a&"' where StudID="&StudID
con.execute(sql)

Response.redirect "adminOJTshowStudmain.asp?sortby=StudID"

con.close
set con=Nothing
%>

Can somebody help me with this?? Any help is more than appreciated! :-)
Reply With Quote
  #2 (permalink)  
Old 01-30-06, 19:09
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
how are you getting/setting the value for StudID? It doesn't appear in the posted code....

Other problems could be in the content of the password.

Before your con.execute line add in Response.Write(sql) and post the resulting line here.
Reply With Quote
  #3 (permalink)  
Old 01-31-06, 03:20
kropes2001 kropes2001 is offline
Registered User
 
Join Date: Nov 2005
Location: Honolulu HI
Posts: 118
it looks like you are not actually retrieving a value for a
"a= Trim(request("passcode"))"

"request" what ?
also.. is StudID a string or a number defined in the database ?
if its a string field then that will blow up in your update
__________________
.
.
http://www.GetMySiteOnline.com - Can you help me Get My Site Online ? (Yes. That is EXACTLY what we do.)

http://www.GetMySiteOnline.com/FightingSpam/
__________________________
caeli enarrant gloriam Dei !
Reply With Quote
  #4 (permalink)  
Old 01-31-06, 16:50
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
if you use request without specifying form or querystring it will try both....

I'm not sure what order it tries in (form then querystring or querystring then form) however.

It can be helpful at times...
Reply With Quote
  #5 (permalink)  
Old 01-31-06, 18:04
kropes2001 kropes2001 is offline
Registered User
 
Join Date: Nov 2005
Location: Honolulu HI
Posts: 118
wow.
never knew that.
__________________
.
.
http://www.GetMySiteOnline.com - Can you help me Get My Site Online ? (Yes. That is EXACTLY what we do.)

http://www.GetMySiteOnline.com/FightingSpam/
__________________________
caeli enarrant gloriam Dei !
Reply With Quote
  #6 (permalink)  
Old 01-31-06, 19:37
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Yeah, it was a few years of developing asp apps before I knew about it either. There are not many places I would use it as it tends to be less efficient then a request.form or request.querystring but it does allow extra flexibility so...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On