I am creating a small windows app., a journal that tracks entries and the date and time they were made.
This was a MS Access app. I wish to use the old .mdb table and create a new interface with vb.net.
I have been able to connect to the .mdb but can't quite figure out how to read through the records yet.
This is the code I am using to connect to my .mdb database.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim oOleDbConnection As OleDb.OleDbConnection
Dim sConnString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Documents and Settings\Jackie\My Documents\journal2.mdb;" & _
"User Id=admin;" & _
"Password="
oOleDbConnection = New OleDb.OleDbConnection(sConnString)
oOleDbConnection.Open()
'Fields in my db are: entry_no, entry_date, entry_time,entry_subject,entry_emotion, and entry
End Sub
This is what I think I know.
I need to define variables.
Read the first record.
Populate my variables with the appropriate data.
Display the info in text boxes on my form.
Repeat these steps as I move through the records.
Or would it be better to read the whole database into memory?
Either way it sounds easy enough but I'm missing the proper syntax.
Could someone please show me a piece of code that would help get me jumpstarted?
FYI
I am using Visual Basic.net 2003
Database was created with MS Access 2000
TIA
Jack
Everything is harder than it looks
nothing is as easy as it seems.
This was a MS Access app. I wish to use the old .mdb table and create a new interface with vb.net.
I have been able to connect to the .mdb but can't quite figure out how to read through the records yet.
This is the code I am using to connect to my .mdb database.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim oOleDbConnection As OleDb.OleDbConnection
Dim sConnString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Documents and Settings\Jackie\My Documents\journal2.mdb;" & _
"User Id=admin;" & _
"Password="
oOleDbConnection = New OleDb.OleDbConnection(sConnString)
oOleDbConnection.Open()
'Fields in my db are: entry_no, entry_date, entry_time,entry_subject,entry_emotion, and entry
End Sub
This is what I think I know.
I need to define variables.
Read the first record.
Populate my variables with the appropriate data.
Display the info in text boxes on my form.
Repeat these steps as I move through the records.
Or would it be better to read the whole database into memory?
Either way it sounds easy enough but I'm missing the proper syntax.
Could someone please show me a piece of code that would help get me jumpstarted?
FYI
I am using Visual Basic.net 2003
Database was created with MS Access 2000
TIA
Jack
Everything is harder than it looks
nothing is as easy as it seems.