Click to See Complete Forum and Search --> : ADO Addnew problems
astauffer
Sep 21st, 2000, 12:40 PM
When trying to run the following code I get a 3251 runtime error. It says "...not supported by the provider...". I am using ADO (ActiveX Libarary 2.1).
----------------------------------------
With rsName
.addnew
.rsName.Fields("fldFirstName").Value = txtFName
.update
End With
-----------------------------------------
the code will not go past the Addnew command. I am new to ADO, so any help would be really appreciated. Thanks
Nathan
Sep 21st, 2000, 01:04 PM
Try This
With rsName
.addnew
.Fields("fldFirstName").Value = txtFName
.update
End With
also if this doesn't work you might want to try to upgrade to ADO version 2.5 available from Microsoft (look for MDAC_TYP.EXE version 2.5)
If you have more problems let me know.
astauffer
Sep 21st, 2000, 03:20 PM
I tried downloading the update...but still no luck. I had my code the way you had showed it, I had made a typo when I posted it on here.
Any idea's?
Here is the code again (should be correct this time)
----------------------------------------------------
Set rsMiscWork = New Recordset
rsMiscWork.Open "tblMiscWork", dbRadio
With rsMiscWork
.AddNew
.Fields("fldDate").Value = txtDate.Text
.Fields("fldSite").Value = cmbSite.Text
.Fields("fldWork").Value = txtWork.Text
.Update
.Requery
End With
------------------------------------------------------
Also the error reads "Object or provider is not capable
of performing requested operation"
DrewDog_21
Sep 21st, 2000, 05:08 PM
I sometimes both of those errors if I forget to specify the
lock type. Try setting the lock type to Optimistic Locking
and see if that helps.
it would look like
Set rsMiscWork = New Recordset
rsMiscWork.Open "tblMiscWork", dbRadio, adOpenKeyset, adLockOptimistic
sanon
Sep 21st, 2000, 09:16 PM
More information.
When you use .open property without specifying any cursor and lock types, the default will be adOpenForwardOnly and adLockReadOnly, repectively. Therefore, if you want to update, you have to specify one of these arguments.
Cursor Type: adOpenKeyset, adOpenDynamic, and adOpenStatic
Lock Type: adLockPessimistic, adLockOptimistic, and adLockBatchOptimistic
astauffer
Sep 22nd, 2000, 11:11 PM
GOT IT!
I set the record locking to optimistic and it started working.
Thanks alot for all the help.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.