asimeone18
New member
- Joined
- Oct 6, 2006
- Messages
- 2
- Programming Experience
- Beginner
I'm still new at this, can anyone tell me if there is a problem with this code. All I want to do is establish a connection to a ms access database. I've tried everything i can think of
VB.NET:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Declare and populate the data table
Dim dt As New DataTable
Dim connStr As String = "Provider = Microsoft.Jet.OLEDB.4.0;" & _
"Data Source = db1.mdb"
Dim sqlStr As String = "SELECT * FROM Some"
Dim dataAdapter As New OleDb.OleDbDataAdapter(sqlStr, connStr)
dataAdapter.Fill(dt)
dataAdapter.Dispose()
dgDisplay.DataSource = dt
End Sub
Last edited by a moderator: