473,385 Members | 1,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 9410
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

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

Similar topics

7
by: (Pete Cresswell) | last post by:
I posted this in the MS Access group, but no luck. ------------------------------------------ I've got another stored procedure in the same app that returns multiple recordsets and the code works....
10
by: Frusterated | last post by:
Hi, I'm using Access-2k under Win-XP... When I have a form with imbedded code it works perfect. Such as the following code example. Dim db as DAO.Database Dim rs as DAO.Recordset Set db =...
2
by: Alex Wisnoski | last post by:
I have an A97 application that I am modifying. I have created an unbound form, "zfrmTestEnterPlacements", with a subform, "zsfrmSelectPlacement". The intent is to use a combo box on the primary...
3
by: RBohannon | last post by:
I've developed a database in Access 2000 on Windows 2000. I have been asked to put the database on a machine running Windows XP. I copied the database onto the XP machine with some data already...
0
by: Kirk | last post by:
I'm trying to use a Web Service to be a Remoting client of an existing ..NET 2.0 server. But I get the following error when I try to use System.Runtime.Remoting.Channels.Http in my WebService. ...
6
by: akoymakoy | last post by:
Run time error 3251 Current Recordset does not support updating, this may be a limitation of the provider, or of the selected Locktype This is my simple program that will split the entries that...
10
richardhodge
by: richardhodge | last post by:
I am a VB6 database programmer and have run into a small problem. The company I work for primarily uses Microsoft Access 2000 for the database that is the back end for our software. Well the...
2
by: kazper | last post by:
Good day, I hope you guys could help me do something about this problem, it seems like I forgot the right codes to use :D Dim adoRS as new ADODB.Connection Dim recRS as Recordset adoRS.Open...
1
by: Jose4u | last post by:
Run time Error '3251' Current Record Set Doesnot support updating. This may be a limitation of the provider or selected locktype
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.