|
-
Jun 3rd, 2004, 07:46 AM
#1
Thread Starter
Hyperactive Member
how to translate VB6.0 ADO to .net
Dear VB users,
Is there someone who can translate the next source to .net?
Wich references do we need to choose?
Set DB = New Connection
DB.Open “connection to sql or mdb”
Set AdoSet = New Recordset
SqlStr = "SELECT * FROM tblMine'"
AdoSet.Open SqlStr, DB
If Not AdoSet.EOF Then
‘. . . . . . . . . .
End If
Thanks for reading,
Michelle
Last edited by michelle; Jun 3rd, 2004 at 08:03 AM.
-
Jun 3rd, 2004, 08:36 AM
#2
Here is some code on doing what you want to do, but you may want to do some more reading on the new OleDb stuff in .net so you can make the best use of the new functionality.
VB Code:
Dim objConn as OleDb.OleDbConnection
'Set our connection string
sConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=dbpath;" & _
"User Id=admin;" & _
"Password="
'Create the connection
objConn = New OleDb.OleDbConnection(sConn)
objConn.Open()
dim objCommand as OleDb.OleDbCommand
dim objRS as oleDB.oleDbDataReader
objCommand = objConn.CreateCommand
objCommand.CommandText = "SELECT * FROM TABLE"
objCommand.Connection = oConn.objConn
objRS = objCommand.ExecuteReader()
While objRS.Read
wend
-
Jun 4th, 2004, 03:43 AM
#3
Hyperactive Member
I'm the only man on this world who uses VB.NET and ADO (not ADO.NET)
I know that ADO.NET can be useful if you need to work disconnected, but if you want to work on a little LAN or a single computer, you can also choose to keep ADO. I choosed ADO because I wanted to use pessimistich locking that ADO.NET doesn't offer. My suggestion: If you really need to use ADO.NET jump on it, but if you don't you can still work with ADO in the same way you did in VB6. Good job!
Live long and prosper (Mr. Spock)
-
Jul 11th, 2004, 03:35 PM
#4
Addicted Member
VB.NET and ADO (not .NET)
How exactly do I take advantage of ADO the old way? I am having trouble finding examples.
Thank you.
-
Jul 12th, 2004, 12:09 AM
#5
I think its as simple as setting a reference to MSADO**.DLL in your project, and then using it the same way.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|