>>>>oUsers.Open "users", oConnection, adOpenKeyset, adLockBatchOptimistic, adCmdTable >>>>>>>>opens the table with all records available. We then have to loop down through the table to find the record we want to edit. Is there a variation on this that would allow the open to function like a "select ... where ..." so we could open directly to the record in question?
>>< % >>Set oConnection = Server.CreateObject("ADODB.Connection") >>Set oTIP = Server.CreateObject("ADODB.Recordset") >>Set oTIP2 = Server.CreateObject("ADODB.Recordset") >>with oConnection >> .ConnectionString = "Provider=VFPOLEDB;Datasource=c:\inetpub\wwwroot\tip\login\data\tipdatabase.dbc" >> .Mode = 16 'adModeShareDenyNone - this is value of adModeShareDenyNone constant >> .Open >> .CursorLocation = adUseClient >> .Execute ("set null off") >>end with >> >>sql = "select * from tip where tip_id=" & lnTIP_ID >>oTIP2.Open sql, oConnection, adOpenKeyset, adLockBatchOptimistic, adCmdText >> >>with oTIP2 >> .addnew >>' HEADER EDITS >> .fields("st_name").value = trim(request.form("st_name")) >> response.write(oTIP2("st_name")+"<BR>") 'shows we are on the right record >> response.write(trim(request.form("st_name"))) 'shows we have the right data >> >> .UpdateBatch >> .close >>end with >>% > >>>>This code works as shown. However if I remove the .addnew with the intent of editing the original record, it fails. I am frustrated because similar code works fine on another table. What can I be missing?