ADO Cursor/Locking type Problem ??Help Pls!!

Results 1 to 2 of 2

Thread: ADO Cursor/Locking type Problem ??Help Pls!!

  1. #1
    Join Date
    Dec 1969

    Default ADO Cursor/Locking type Problem ??Help Pls!!

    Plsease Help me Whenever I try to update the database by using the following code it gives me the following error:<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80004005&#039 <BR><BR>[Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object is read-only. <BR><BR>Code is as follows:<BR><BR>Dim rsponoins,mycon,str<BR> Set mycon = Server.CreateObject ("ADODB.Connection")<BR> str= "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("profile1.mdb") <BR> mycon.Open str,adOpenStatic<BR> Set rsponoins = Server.CreateObject ("ADODB.Recordset")<BR> &#039&#039rsponoins.LockType = adLockPessimistic<BR> rsponoins.Open "Profile1", mycon,1,2, adCmdTable<BR> &#039, adOpenKeyset , adLockOptimistic , adCmdTable<BR> rsponoins.AddNew<BR><BR> &#039 My fields here<BR> &#039<BR> &#039<BR> &#039<BR><BR> rsponoins.update<BR> &#039&#039rsponoins.Requery <BR> rsponoins.Close<BR> Set rsponoins = Nothing<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default wrong approach ..

    to add a record u should use, insert sql statement.<BR>for example:<BR>sql1 = "insert into table1 (fld1) values (&#039x1&#039)"<BR>then execute the insert.<BR><BR>if u really want to open a rs,limit the records that u query.

Posting Permissions

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