addnew, update, movelast gives error

Results 1 to 2 of 2

Thread: addnew, update, movelast gives error

  1. #1
    Join Date
    Dec 1969

    Default addnew, update, movelast gives error

    error i&#039;m getting is:<BR>Microsoft OLE DB Provider for ODBC Drivers (0x80040E2F)<BR>[Microsoft][ODBC Microsoft Access Driver]Error in row <BR>/ line 33 <BR><BR>on line above i&#039;ve statement to update record rsd.update<BR><BR>Below is my code:<BR><BR>set conn = server.Createobject("ADODB.Connection")<BR>conn.Op en ("DSN=dsnname")<BR>set rsd = Server.CreateObject("ADODB.Recordset")<BR>sql ="SELECT * from products"<BR> sql, conn , adOpenStatic , adlockpessimistic , adcmdtext<BR>rsd.addnew<BR>rsd("model") = model<BR>rsd("serialnum") = serial<BR>rsd("listprice") = listprice<BR>rsd("yourprice") = yourprice<BR>rsd("prodfeature") = feature<BR>rsd("image") = img<BR>rsd("des") = proddes<BR>rsd.update<BR>rsd.movelast<BR>prodid = rsd("prodid")<BR><BR>What I&#039;m doing wrong here?I do have include the top of the page.<BR><BR>Thannks in advance<BR>

  2. #2
    Join Date
    Dec 1969

    Default What is this movelast doing here??

    when you are adding a new record with "Addnew", then you have already sent the cursor to the end.<BR><BR>Looking at the lines after your "rsd.update", it seems you are trying to capture the value of "prodid" field from the table which I believe would be an autonumber, so I can only say, I dont think this CAN be done this way.

Posting Permissions

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