updating database

Results 1 to 2 of 2

Thread: updating database

  1. #1
    Join Date
    Dec 1969

    Default updating database

    When I ran this using PWS on my computer it came out fine. However when I moved it to https on the web with MySql I&#039;m getting all kinds of errors. My script is this:<BR><BR>&#060;%<BR>&#039;open connection<BR>set objconn =Server.CreateObject("ADODB.connection")<BR> objconn.open MM_mj_STRING<BR> <BR> &#039; open recordset object with the Orders table. (objconn)<BR> set objrs = server.CreateObject("adodb.recordset")<BR> objrs.Open "orderdetails", objconn, adOpenKeyset, adLockOptimistic, adCmdTable<BR><BR><BR><BR> &#039;Now, let&#039;s loop through the array<BR> &#039; START -- FOR loop<BR> for i = 0 to ubound(cart,2)<BR> if cart(0,i) &#060;&#062; "" then &#039;START -- IF condition statement<BR><BR> &#039;Add a new row to the Recordset<BR> objrs.addnew<BR> objrs("fabtype") = cart(4,i)<BR> objrs("fabquantity") = cart(2,i)<BR> objrs("fabcolor") = cart(3,i)<BR> objrs("custid") = customerid<BR> objrs.Update<BR><BR> end if &#039;END -- IF condition statement<BR> next<BR><BR> &#039; kill recordset/connection object<BR> objrs.Close<BR> set objrs = nothing<BR> objconn.Close<BR> Set objconn = nothing<BR> %&#062;<BR><BR>If there is info in the database I get the following error: <BR><BR>Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. <BR><BR>If the database is empty, I get a different error:<BR><BR>[Microsoft][ODBC Driver Manager] Invalid string or buffer length <BR><BR>I&#039;m trying to populate an orders table, any idea why this isn&#039;t working?

  2. #2
    Join Date
    Dec 1969

    Default DEBUG time...

    I&#039;d start by removing the various objrs("xxxx")=yyy lines, one at a time, until it works. [That will only work if you have the DB allow nulls in the various columns, at least temporarily.]<BR><BR>Do you get those two errors on the same line?<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