help needed with SQL "UPDATE" with new OLEDB conn

Discussion in 'Databases' started by runfirst, Sep 12, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I figured my problem. I didn't realize that the UPDATE syntax was different than the ODBC drivers...


    I was browsing back through the user forum... and found that the syntax for the new OLDEB uses (aparently):

    UPDATE table SET table.columnY WHERE table.column.X = ...

    and I was using

    UPDATE table SET columnY WHERE columnX = ...

    seems odd that this fixed my problem? [}:)]

    Runfirst.[8D]
     
  2. I have recently switched to the new OLEDB Jet 4.0 connection string, and all my SELECT querries are working fine. However, I'm reworking some "UPDATE" commands and things aren't working. I keep getting the error:

    SQL syntax error in UPDATE statment. source=Microsoft Jet Engine
    (or something very close to that)

    Here is my code snippet: I'm using the connection object directly to execute my SQL statment. If someone knows why this isn't working, I'd surely appreciate an email or reply. Again, the actual connection is working fine... just the UPDATE isn't working...
    ____________________________________________________________
    dim szConn
    dim conn
    szConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=xxxxxxxx(deleted for privacy);User ID=Admin;"
    set conn = Server.CreateObject("ADODB.Connection")
    conn.Open szConn

    dim szSQL
    szSQL = "UPDATE Admin SET Password = '" & Request.Form("Password2") & "' WHERE Username = 'yousoldit'"
    on error resume next

    conn.Execute szSQL, adAffectCurrent

    if err<>0 then
    Response.Write(err.Description & " " & err.Source )
    else
    Response.Write("GOOD! YOU DID IT!!")
    end if
    __________________________________________________________________
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page