Hello. I have an access database named profees.mdb. Inside of it is a table named tblInsurance. However, whenever I tried to fill the dataset in my code, I get an error saying,
"The Microsoft Jet database engine cannot find the input table or query 'tblInsurance'. Make sure it exists and that its name is spelled correctly."
Below is my very simple code:
"The Microsoft Jet database engine cannot find the input table or query 'tblInsurance'. Make sure it exists and that its name is spelled correctly."
Below is my very simple code:
VB.NET:
Imports System.Data
Public Class test
Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoad.Click
' Setup Connection Object; con will hold the connection object
Dim con As New OleDb.OleDbConnection
Dim ds As New DataSet
Dim da As OleDb.OleDbDataAdapter ' Data adapter
Dim sql As String
' Setup the Connection String; con is the connection string
con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = \profees.mdb"
' Open the connection to the database
con.Open()
sql = "Select * From tblInsurance"
' Create the data adapter
da = New OleDb.OleDbDataAdapter(sql, con)
' Fill the dataset from the data adapter
da.Fill(ds, "ProFees")
MsgBox("A Connection to the Database is now open")
' Close the connection to the database
con.Close()
MsgBox("The Connection to the Database is now Closed")
End Sub
End Class