473,563 Members | 2,867 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ADO runtime error 3251

1 New Member
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'.
*************co de************* *************



Dim cn As New ADODB.Connectio n
cn.Open "Driver={Micros oft Access Driver (*.mdb)};Dbq=c: \Website Projects\ExitCa shFlow\logMaste r\Logs.mdb;"

dim recdcath as adodb.recordset

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

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 9425
mra
15 New Member
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'.
*************co de************* *************
please try the following code

Dim cn As New ADODB.Connectio n
cn.Open "Driver={Micros oft Access Driver (*.mdb)};Dbq=c: \Website Projects\ExitCa shFlow\logMaste r\Logs.mdb;"

dim recdcath as adodb.recordset

tstrSQL = "select * from ct_enccath where cteh_reg_no ='" & txtpat(0).Text & "'"
set recdcath=cn.Exe cute(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.Connectio n
cn.Open "Driver={Micros oft Access Driver (*.mdb)};Dbq=c: \Website Projects\ExitCa shFlow\logMaste r\Logs.mdb;"

dim recdcath as adodb.recordset

tstrSQL = "select * from ct_enccath where cteh_reg_no ='" & txtpat(0).Text & "'"
recdcath.open tstrSQL,cn,adOp enKeyset, adLockOptimisti c
if recdcath.record count=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
16495
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. But now I've written another SP and the code traps out with the 3251 message. The SP is writing two recordsets. When I run the SP in Query...
10
11821
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 = CurrentDB set rs = db.OpenRecordset("MyTable")
2
11917
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 form to look up 'exhibitor-entry' data and populate a few fields on this form. The EntryID(number-long data type) will be passed to a textbox on...
3
4295
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 in it. Everything seemed to be working correctly, until I tried to import new data. New data is imported into the database from a floppy disk. To...
0
755
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. The same code works fine in a standalone app. I have inspected System.Runtime.Remoting.dll with ildasm, and I can see the ....Channels.Http...
6
9649
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 have 2 words in it and put it in separate fields: im using MSaccess for my tables for example: before field1= word1, word2
10
6746
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 functionality that I am currently working on creates a table in one database and then links it into the primary database that is used by the program to store...
2
2135
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 "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=User;Initial Catalog=Dbase;Data Source=DBase", "user", "Password" Set recRS =...
1
815
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
0
7665
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7583
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7888
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6255
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1200
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.