mrojas
Member
I'm using VB2008 and want to connect to a Access 2007 database. I have the following code and receive the above error message when I step it through the code:
Imports Microsoft.Data.Odbc
Public Class frmODBCsample
Private Sub btnConnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConnect.Click
On Error GoTo ErrorArea
Dim conStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\TicketingSystem.mdb; Persist Security Info=False"
Dim strQuery As String = "SELECT * FROM Authors"
Dim conDB As New OdbcConnection(conStr)
conDB.Open()
Could anyone tell me what I'm missing or doing wrong?
Thanks in advance.
Milton
Imports Microsoft.Data.Odbc
Public Class frmODBCsample
Private Sub btnConnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConnect.Click
On Error GoTo ErrorArea
Dim conStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\TicketingSystem.mdb; Persist Security Info=False"
Dim strQuery As String = "SELECT * FROM Authors"
Dim conDB As New OdbcConnection(conStr)
conDB.Open()
Could anyone tell me what I'm missing or doing wrong?
Thanks in advance.
Milton