Update Connection

Results 1 to 2 of 2

Thread: Update Connection

  1. #1
    Join Date
    Dec 1969

    Default Update Connection

    I&#039;m trying to configure an update page, but with little luck! I keep getting this error code, which I think is a connection problem. But I need help solving it.<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039;80040e07&#039; <BR><BR>[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression. <BR><BR>/updatestock.asp, line 35 <BR><BR>Here is my asp code:<BR>Set objConn = Server.CreateObject("ADODB.Connection")<BR>Set objRS = Server.CreateObject("ADODB.RecordSet")<BR><BR>acce ssdb="project.mdb"<BR>myDSN="DRIVER={Microsoft Access Driver (*.mdb)};"<BR>myDSN=myDSN & "DBQ=" & server.mappath(accessdb)<BR><BR>updatedstock = currentstock - 1<BR><BR>mySQL = "UPDATE film SET "<BR>mySQL = mySQL & "stock=&#039;" & updatedstock & "&#039;"<BR>mySQL = mySQL & " WHERE film_no=&#039;" & film & "&#039;"<BR><BR>objConn.Open myDSN<BR>objRS.Open mySQL,objConn,3,3 ===&#062; line 35<BR><BR>If anyone can help I would me most grateful,<BR><BR>Cheers, Tom ==&#062; thvr@bton.ac.uk

  2. #2
    peterjl@austec.net.au Guest

    Default Nothing to do with connection, SQL Syntax problem!

    I assume that you are trying to update a stock qantity, which would be a number. You update is assigning a string to the field. Just remove the single quotes around the value. It should be: <BR><BR>mySQL = "UPDATE film SET "<BR>mySQL = mySQL & "stock=" & updatedstock & ""<BR>mySQL = mySQL & " WHERE film_no=&#039;" & film & "&#039;"<BR><BR>

Posting Permissions

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