Insert error

Results 1 to 4 of 4

Thread: Insert error

  1. #1
    Join Date
    Dec 1969

    Default Insert error

    Having a bad Sunday. Any working Sunday is a bad one I guess. At any rate I get this error:<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039;80040e14&#039; <BR><BR>[Microsoft][ODBC Microsoft Access Driver] Invalid SQL statement; expected &#039;DELETE&#039;, &#039;INSERT&#039;, &#039;PROCEDURE&#039;, &#039;SELECT&#039;, or &#039;UPDATE&#039;. <BR><BR>/stroberts/church/servers/serverentry2.asp, line 26 <BR><BR>With this code. The Insert statement looks fine to me. Line 26 is the RS.Open line. It&#039;s not even seeing the Insert below that??? Any thought sappreciated.<BR><BR>ID = request.form("ID")<BR>AllCerts = Request("AllCerts")<BR><BR>appCerts = Split( Request("AllCerts") , "#" )<BR><BR>Set conn = Server.CreateObject("ADODB.Connection")<BR><BR>con n.Open "DRIVER=Microsoft Access Driver (*.mdb);" _<BR> & "DBQ=" & Server.MapPath("serversched.mdb")<BR><BR>Set RS = Server.CreateObject("ADODB.RecordSet")<BR><BR>RS.O pen "schedsevers", conn, adOpenKeyset, adLockOptimistic<BR><BR>For cnum = 0 To UBound(appCerts) - 1<BR> certInfo = Split( appCerts(cnum), "#" ) <BR> SQL = "INSERT INTO schedservers " _<BR> & "(serverID, ID) " _<BR> & " VALUES ("& certInfo(0) & "," _<BR> & "" & ID & ")"<BR> conn.Execute( SQL )<BR> <BR>Next<BR>rs.close<BR><BR> Conn.Close<BR> Set Conn=nothing<BR><BR>

  2. #2
    scopeout Guest

    Default RE: Insert error

    Try this<BR><BR>comment out conn.Execute( SQL )<BR>and response.write SQL and look at your SQL statement

  3. #3
    Join Date
    Dec 1969

    Default Yep found it

    I had the table name spelled wrong in the RS.Open statement. Sheesh! Thanks

  4. #4
    Scopeout Guest

    Default Coooool Dude!


Posting Permissions

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