Hi, I have an access databse, but the data is link to excel, so i cant changes the data inside access database. However, i just want to retrieve the data inside the access database using VB datagridview, but the system pop out an error said 'cannot find the input table or query'
Is it because the data is link with excel, so access databse cannot direct take the data?
Below is my code:\
Dim myconnectionstring As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb"
myconnection = New OleDbConnection(myconnectionstring)
query = ("SELECT Device,Package FROM [Sheet1$]")
mycommand = New OleDbCommand(query, myconnection)
dr = mycommand.ExecuteReader
DataGridView1.Rows(n).Cells("Column1").Value = dr("Device")
DataGridView1.Rows(n).Cells("Column2").Value = dr("Package")