I have several Access DB Queries that i would like to use to create arrays in a vb.net program. I believe i have the proper code to access the db, but i'm curious as to what method i would use to convert it to a array. Any one have ideas?
Here is the code i use to connect:
Then I store the Access query commands as strings to run against the DB later:
Then I build strings to execute commands against the DB:
I'm not entirely sure that is the correct way to go about it.. but my limited vb.net knowledge pointed me in this direction, but i'm lost as to how i'd put the queried data into an array.
Here is the code i use to connect:
Code:
Dim ConnectionString As String _
= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\pathtodata\database.mdb;User Id=admin;Password=;"
Dim ObjCon As New OleDbConnection(ConnectionString)
Then I store the Access query commands as strings to run against the DB later:
Code:
Dim SampleQuery As String = "SELECT AccessTable.Field0, AccessTable.Field1, AccessTable.Field2, FROM AccessTable;"
Then I build strings to execute commands against the DB:
Code:
Dim ExecuteQuery As New OleDbCommand(SampleQuery)
ObjCon.Open()
ExecuteQuery.ExecuteReader()
I'm not entirely sure that is the correct way to go about it.. but my limited vb.net knowledge pointed me in this direction, but i'm lost as to how i'd put the queried data into an array.