PC Review


Reply
Thread Tools Rate Thread

accessing ADODB Recordset problem

 
 
Guest
Posts: n/a
 
      3rd Mar 2004
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 wayim rs As New
ADODB.Recordsetrs.ActiveConnection = Connectionrs.CursorLocation =
2rs.CursorType = 0rs.LockType = 1rs.Source = "SELECT * FROM Accounts"
rs.Open()


 
Reply With Quote
 
 
 
 
CJ Taylor
Guest
Posts: n/a
 
      3rd Mar 2004
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/>" <(E-Mail Removed)> wrote in message
news:c24mrr$1o9kp4$(E-Mail Removed)...
> 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 wayim rs As New
> ADODB.Recordsetrs.ActiveConnection = Connectionrs.CursorLocation =
> 2rs.CursorType = 0rs.LockType = 1rs.Source = "SELECT * FROM Accounts"
> rs.Open()
>
>



 
Reply With Quote
 
Merlin
Guest
Posts: n/a
 
      3rd Mar 2004
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/>" <(E-Mail Removed)> wrote in message
news:c24mrr$1o9kp4$(E-Mail Removed)...
> 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 wayim rs As New
> ADODB.Recordsetrs.ActiveConnection = Connectionrs.CursorLocation =
> 2rs.CursorType = 0rs.LockType = 1rs.Source = "SELECT * FROM Accounts"
> rs.Open()
>
>



 
Reply With Quote
 
Guest
Posts: n/a
 
      3rd Mar 2004
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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ADODB.Recordset Add Record problem Robert Nusz via AccessMonster.com Microsoft Access Form Coding 1 25th Feb 2005 12:54 PM
Problem with Set combobox.recordset = <adodb.recordset> Gijs Beukenoot Microsoft Access Form Coding 0 10th Nov 2004 06:22 PM
ADODB Recordset problem Stefen Percoco Microsoft Excel Programming 2 26th Jul 2004 06:31 PM
Problem with ADODB.Recordset using LIKE operator. Alberto Uttranadhie Microsoft Access VBA Modules 2 10th Dec 2003 06:56 AM
Accessing data from a ADODB.recordset Andy Barber Microsoft VB .NET 6 21st Aug 2003 04:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:54 PM.