469,904 Members | 2,120 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,904 developers. It's quick & easy.

ADO runtime error 3251

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
1 8946
mra
15
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.

Similar topics

10 posts views Thread by Frusterated | last post: by
3 posts views Thread by RBohannon | last post: by
1 post views Thread by Jose4u | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.