473,320 Members | 2,117 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,320 software developers and data experts.

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.Recordset) 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=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=C:\dbs\db1.mdb;
Recordset1.LockType = 1
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2So i accessed ADODB in this way:Dim rs As New
ADODB.Recordsetrs.ActiveConnection = Connectionrs.CursorLocation =
2rs.CursorType = 0rs.LockType = 1rs.Source = "SELECT * FROM Accounts"
rs.Open()
Nov 20 '05 #1
3 6601
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********@yahoo.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.Recordset) 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=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=C:\dbs\db1.mdb;
Recordset1.LockType = 1
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2So i accessed ADODB in this way:Dim rs As New
ADODB.Recordsetrs.ActiveConnection = Connectionrs.CursorLocation =
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.OleDb
Imports ADODB

Dim Db As New ADODB.Recordset

Db.CursorLocation = CursorLocationEnum.adUseClient
Db.Open("SELECT * FROM Accounts", _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\dbs\db1.mdb;" & _
"user id=;password=;", _
CursorTypeEnum.adOpenStatic,
LockTypeEnum.adLockOptimistic)
do while not db.eof
mygrid= db("my field name").value
db.movenext
loop
db.close
db.activeconnection=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("SELECT * FROM Accounts"', simply replace the "SELECT *
FROM Accounts", with a table name for direct table access.
Hope this helps......

Regards,
Merlin
"<spider/>" <bo********@yahoo.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.Recordset) 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=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=C:\dbs\db1.mdb;
Recordset1.LockType = 1
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2So i accessed ADODB in this way:Dim rs As New
ADODB.Recordsetrs.ActiveConnection = Connectionrs.CursorLocation =
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
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...
0
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...
0
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...
6
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...
7
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...
2
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...
3
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...
0
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...
6
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.