Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2003
    Posts
    3

    Unanswered: 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!

  2. #2
    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!

  3. #3
    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

  4. #4
    Join Date
    Jan 2003
    Posts
    3

    Thumbs up

    Thanks Your a real Help m8 , i was freckin stuck

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •