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 > ASP Error :S need help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-24-03, 04:24
Cunni Cunni is offline
Registered User
 
Join Date: Jan 2003
Posts: 3
ASP Error :S need help

Hi im new on here so please go easy :P, i am working on a Gaming Group Database, this is the first real bit of coding i done, but i am getting this error Line 60 = Set RS = MyConn.Execute(SQL)
Can any of u lot help poor old me ? Please



Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
/2d/update.asp, line 60



Sub Edit(MyConn)

Dim id, username, password, level, expdate

id = CInt(Request.Form("id"))
username = Replace(Request.Form("username"), "'", "''")
password = Replace(Request.Form("password"), "'", "''")
level = CInt(Request.Form("level"))
expdate = Request.Form("expdate")

SQL = "Update Login Set UserName = '"&username&"', [PassWord] = '"&password&"'"
SQL = SQL & ", Clearance = "&level&", ExpireDate = '"&expdate&"' Where ID = "&id&""

Set RS = MyConn.Execute(SQL)

CleanUp2()

Response.Redirect "admin.asp"

End Sub



HELP!
Reply With Quote
  #2 (permalink)  
Old 01-24-03, 04:28
Cunni Cunni is offline
Registered User
 
Join Date: Jan 2003
Posts: 3
Ah shit wrong Code hold on.

Sub Edit(MyConn)

Dim id, username, password, level, age, email

id = CInt(Request.Form("id"))
username = Replace(Request.Form("username"), "'", "''")
password = Replace(Request.Form("password"), "'", "''")
level = CInt(Request.Form("level"))
age = Request.Form("age")
email = Request.Form("email")

SQL = "Update Login Set UserName = '"&username&"', [PassWord] = '"&password&"'"
SQL = SQL & ", Clearance = "&level&", age = '"&age&"', email = '"&email&"', ' Where ID = "&id&""

Set RS = MyConn.Execute(SQL)

CleanUp2()

Response.Redirect "members.asp"

End Sub

thats the Page!
Reply With Quote
  #3 (permalink)  
Old 01-24-03, 10:34
pjames pjames is offline
Registered User
 
Join Date: Jan 2003
Posts: 23
Use this:

SQL = "Update Login Set UserName = '"&username&"', [PassWord] = '"&password&"'"
SQL = SQL & ", Clearance = "&level&", age = '"&age&"', email = '"&email&"' Where ID = "&id&""

You had a stray ",'" just before The WHERE clause
Reply With Quote
  #4 (permalink)  
Old 01-24-03, 11:33
Cunni Cunni is offline
Registered User
 
Join Date: Jan 2003
Posts: 3
Thumbs up

Thanks Your a real Help m8 , i was freckin stuck
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