As promised, I am back to give you a short tutorial the best I know how.
First, you will need to add a reference to your project.
To do this, go to the Project -> Add Reference. Go to the "COM" tab and scroll down to find the Microsoft ActiveX Data Objects 2.7 Library. Highlight it and click Select on the Right. Click OK to add the reference and if asked, click Yes to add the wrapper (if not asked, dont worry about it). here is what it will look like (roughly)
[Broken External Image]:
http://www.tonka6969.homestead.com/files/AddReference.JPG
Then in your code use this.
Code:
Dim cnADOConnection As New ADODB.Connection()
To open your connection, use the following, I am assuming you are using access, so I will include that.
Code:
m_cnADOConnection.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source = "C:\Filename.mdb")
I set my recordset variables as global, but it is up to you. where ever you want to put the code, you can.
Code:
Dim rstRecordset as New ADODB.Recordset()
When opening your recordset, use the following format:
Code:
rstRecordset.Open("TableName", m_cnADOConnection, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic)
Now, of course, the permissions you set will vary according to what you want to do with it. These permissions give you the most freedom.
Finally, to move around in the records, and such.
Code:
rstRecordset.MoveFirst
rstRecordset.MovePrevious
rstRecordset.MoveNext
rstRecordset.MoveLast
Also, by typing rstRecordset and then a period, you can search through some of the other methods and properties of the recordset that you can play with.
Hopefully, that will give you some help. if you need any more help, just let me know and I will try to the best of my ability.
Like I said before, this might not be the best way to do it, but it works.
Good Luck.