By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,737 Members | 1,473 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,737 IT Pros & Developers. It's quick & easy.

ADO runtime error 3251

P: 1
I am trying to convert the code that was written in VB using DAO to ADO.
But when i tried to do following getting an error '3251'.
*************code**************************



Dim cn As New ADODB.Connection
cn.Open "Driver={Microsoft Access Driver (*.mdb)};Dbq=c:\Website Projects\ExitCashFlow\logMaster\Logs.mdb;"

dim recdcath as adodb.recordset

tstrSQL = "select * from ct_enccath where cteh_reg_no ='" & txtpat(0).Text & "'"
Set recdcath = cn.Execute(tstrSQL)

recdcath.Addnew

*******************************************


Please let me know what I need to add to open this up in read/write. (It stops on the recdcath.Addnew and displays the error Runtime error '3251' Current Recordset does not support updating. This may be a limitation of the Provider, or of the select Locktype).
Sep 22 '06 #1
Share this Question
Share on Google+
1 Reply


P: 15
mra
I am trying to convert the code that was written in VB using DAO to ADO.
But when i tried to do following getting an error '3251'.
*************code**************************
please try the following code

Dim cn As New ADODB.Connection
cn.Open "Driver={Microsoft Access Driver (*.mdb)};Dbq=c:\Website Projects\ExitCashFlow\logMaster\Logs.mdb;"

dim recdcath as adodb.recordset

tstrSQL = "select * from ct_enccath where cteh_reg_no ='" & txtpat(0).Text & "'"
set recdcath=cn.Execute(tstrSQL)
recdcath.Addnew
*******************************************


Please let me know what I need to add to open this up in read/write. (It stops on the recdcath.Addnew and displays the error Runtime error '3251' Current Recordset does not support updating. This may be a limitation of the Provider, or of the select Locktype).


please try the following code

Dim cn As New ADODB.Connection
cn.Open "Driver={Microsoft Access Driver (*.mdb)};Dbq=c:\Website Projects\ExitCashFlow\logMaster\Logs.mdb;"

dim recdcath as adodb.recordset

tstrSQL = "select * from ct_enccath where cteh_reg_no ='" & txtpat(0).Text & "'"
recdcath.open tstrSQL,cn,adOpenKeyset, adLockOptimistic
if recdcath.recordcount=0 then ' if necessary
recdcath.Addnew

endif
Sep 28 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.