Error when using OLE DB but not ODBC?

Results 1 to 2 of 2

Thread: Error when using OLE DB but not ODBC?

  1. #1
    Join Date
    Dec 1969

    Default Error when using OLE DB but not ODBC?

    Hi, <BR><BR>When I use a dsn-less connection ODBC like below everything in my application runs fine (add,update,delete)... <BR><BR>Driver={Microsoft Access Driver (*.mdb)}; DBQ=C:datadata.mdb; <BR><BR>But using the OLE DB provider like below... <BR><BR>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:datadata.mdb;Persist Security Info=False <BR><BR>only allows me to add/delete, I get the following error when updating.. <BR><BR>Microsoft JET Database Engine error &#039;80040e14&#039; <BR><BR>Invalid SQL statement; expected &#039;DELETE&#039;, &#039;INSERT&#039;, &#039;PROCEDURE&#039;, &#039;SELECT&#039;, or &#039;UPDATE&#039;. <BR><BR>Line # <BR><BR>My sql statement is fairly simple passing a parameter to the database query. <BR><BR>intVarId = Session("VarId")<BR><BR>&#039;Create The SQL<BR>Dim strSQLUpdate<BR>strSQLUpdate = "qryUpdate " & intVarId<BR><BR>&#039;Open Recordset<BR>Dim objUpdate<BR>Set objUpdate = Server.CreateObject("ADODB.Recordset")<BR>objUpdat e.Open strSQLUpdate, objConn, 0, 3<BR><BR>Any ideas as to what may be happening? It works fine if I change the 3 to a 1 (Lock Read Only) but then of course I get an update error because it is not set for updating.<BR><BR>I have searched microsoft and this site for an answer (and my wrox books) but can&#039;t seem to find anything. <BR><BR>Thanks!

  2. #2
    Join Date
    Dec 1969

    Default RE: Error when using OLE DB but not ODBC?

    this is a built-in access query?<BR><BR>use the command syntax for it, or just .execute() it.<BR><BR>see for a tutorial<BR><BR>j

Posting Permissions

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