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()