473,785 Members | 2,829 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

accessing ADODB Recordset problem

Hello ppl,

I have snippet that works fine udner ADODB with VB6, but something wrong
with it in Vb.NET. Anyone can help?

Recordset1 (ADODB.Recordse t) Error: Arguments are of the wrong type, are out
of acceptable range, or are in conflict with one another.
Error Source:

SELECT * FROM Accounts
PROVIDER=MICROS OFT.JET.OLEDB.4 .0;DATA SOURCE=C:\dbs\d b1.mdb;
Recordset1.Lock Type = 1
Recordset1.Curs orType = 0
Recordset1.Curs orLocation = 2So i accessed ADODB in this way:Dim rs As New
ADODB.Recordset rs.ActiveConnec tion = Connectionrs.Cu rsorLocation =
2rs.CursorType = 0rs.LockType = 1rs.Source = "SELECT * FROM Accounts"
rs.Open()
Nov 20 '05 #1
3 6629
ADO 2.x is dead. ADOX is the new way to go and its a bit different. Have a
look-see at DataAdapters to compare them to your recordsets...

In VB6 you were used to a connected dataset (where data was held within the
recordset object)... not anymore, data is separate from the recordset in a
disconnected form (you don't maintain your connection with the server...)

HTH,
CJ
"<spider/>" <bo********@yah oo.com> wrote in message
news:c2******** *****@ID-155519.news.uni-berlin.de...
Hello ppl,

I have snippet that works fine udner ADODB with VB6, but something wrong
with it in Vb.NET. Anyone can help?

Recordset1 (ADODB.Recordse t) Error: Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
Error Source:

SELECT * FROM Accounts
PROVIDER=MICROS OFT.JET.OLEDB.4 .0;DATA SOURCE=C:\dbs\d b1.mdb;
Recordset1.Lock Type = 1
Recordset1.Curs orType = 0
Recordset1.Curs orLocation = 2So i accessed ADODB in this way:Dim rs As New
ADODB.Recordset rs.ActiveConnec tion = Connectionrs.Cu rsorLocation =
2rs.CursorType = 0rs.LockType = 1rs.Source = "SELECT * FROM Accounts"
rs.Open()

Nov 20 '05 #2
Hi,

I'm not an ADO.NET convert yet! I use ADODB and the speed to me is lightning
fast i,e. populate a grid with 200,000 records in a fraction of a second
from an MS database!!!!

Imports System.Data
Imports System.Data.Ole Db
Imports ADODB

Dim Db As New ADODB.Recordset

Db.CursorLocati on = CursorLocationE num.adUseClient
Db.Open("SELECT * FROM Accounts", _
"Provider=Micro soft.Jet.OLEDB. 4.0;" & _
"Data Source=C:\dbs\d b1.mdb;" & _
"user id=;password=;" , _
CursorTypeEnum. adOpenStatic,
LockTypeEnum.ad LockOptimistic)
do while not db.eof
mygrid= db("my field name").value
db.movenext
loop
db.close
db.activeconnec tion=nothing

NOTES:
a) If you ever use the LIKE 'a*' query at any time use LIKE 'a%' instead
(note the %, instead of star).
b) In then 'Db.Open("SELEC T * FROM Accounts"', simply replace the "SELECT *
FROM Accounts", with a table name for direct table access.
Hope this helps......

Regards,
Merlin
"<spider/>" <bo********@yah oo.com> wrote in message
news:c2******** *****@ID-155519.news.uni-berlin.de...
Hello ppl,

I have snippet that works fine udner ADODB with VB6, but something wrong
with it in Vb.NET. Anyone can help?

Recordset1 (ADODB.Recordse t) Error: Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
Error Source:

SELECT * FROM Accounts
PROVIDER=MICROS OFT.JET.OLEDB.4 .0;DATA SOURCE=C:\dbs\d b1.mdb;
Recordset1.Lock Type = 1
Recordset1.Curs orType = 0
Recordset1.Curs orLocation = 2So i accessed ADODB in this way:Dim rs As New
ADODB.Recordset rs.ActiveConnec tion = Connectionrs.Cu rsorLocation =
2rs.CursorType = 0rs.LockType = 1rs.Source = "SELECT * FROM Accounts"
rs.Open()

Nov 20 '05 #3
hi there, maybe its sounds stupid, but ia have to access to ADODB.Recrdset
throught CreateObject within VB.NET and got my RS working fine, but for some
reason "native" ADODB.NET fires this damn error...

..ev
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4083
by: Robertb | last post by:
I'm driving myself crazy trying to figure this one out. So much so that I think I'm within walking distance now! The program is written and compiled in Visual Basic 6 with SP5. The OS is Windows XP Professional. The other day, it worked just fne. Today it doesn't. I had this same problem a few weeks ago, but it mysteriously went away. Well, now it's back. What did I change? I have no idea. Lot's of stuff, I suppose. I don't...
0
2880
by: elcc1958 | last post by:
I need to support a VB6 application that will be receiving disconnected ADODB.Recordset from out DotNet solution. Our dotnet solution deals with System.Data.DataTable. I need to populate a disconnected ADODB.Recordset from System.Data.DataTable data. Below is the source code I am implementing to test the process. I do not get any error, that I can see. The problem I have is that at the end, the recordset seems to be empty. Any...
0
1519
by: mad | last post by:
I am new here and don't know if someone has encountered and discussed this problem before. I appreciate any help to this problem. I am building a new Oracle database (8.1.7) and Win 2000/IIS 5 for development. After I moved ASP pages over from another server (also Oracle 8.1.7 and Win 2000/IIS 5), the error occurred when recordset's MoveNext is called. Here is the code: <% Set cmdTemp = Server.CreateObject("ADODB.Command") Set rsProd...
6
13999
by: Andy Barber | last post by:
Hi, I'm trying to write an app that reads data from a table into a string variable for later use in my program. Below is a snippet of the code I'm using, which compiles ok, but at runtime I get and error 'Object reference not set to an instance of an object.' as soon as I try to access the data in the fields, I.e. at the line that reads 'KeyFlags(i) = rstFields("keyflag").value'
7
2916
by: boyleyc | last post by:
Hi all I have written a database in access and used ADODB recordsets all the way through. The only recordsets that are not ADODB are the listbox navigation code automatically generated by access 2003 as follows : ' Find the record that matches the control. Dim rs As Object Set rs = Me.Recordset.Clone
2
2039
by: geoff.agnew | last post by:
Hi, I'm doing a web based tracking system for exam questions. Using ASP with VBScript to link the database. I have the main log in screen working but when i enter the log in details i get this error: - Error Type Provider (0x80004005) Unspecified error /ets/functions.asp, line 20
3
6106
by: mark_aok | last post by:
Hi all, All I am trying to do is open a table, edit it, and then close it. But I am having the strangest error. Here is my code Dim i as integer Dim rs as adodb.recordset Set rs = new ADODB.recordset rs.open "SELECT * FROM ITEM",CurrentProject.Connection, adOpenStatic, adLockOptimistic
0
1550
by: PCroser | last post by:
I have encountered a problem when querying a table. The query passed data into a recordset which should have resulted in many records but has returned EOF. After debugging the code the only solution i have found is that i have set the recordset to NEW ADODB.RECORDSET two times before actually perfoming the rs.open (once in the main program and once in the dll which contains the loadrecords function). MAIN PROGRAM Dim rs as NEW...
6
5174
by: Oko | last post by:
I'm currently developing an MS Access Data Project (.adp) in MS Access 2002. One of the reports within the DB uses data that is Dynamic and cannot be stored on the SQL Server. To resolve this, I have created an ADODB.Recordset in the reports OPEN event, built the necessary records inside of it, and then bound the report to this newly created recordset. Here's the rub:
0
9645
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10327
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10151
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9950
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8973
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5381
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.