MY Code is not working. I'm getting an "Unspecified Error" when trying to connect to an MS Access database:
When I run in debug mode and break on con.Open() I see that the ServerVersion value is: <error: an exception of type: {System.InvalidOperationException} occurred>
Thanks in advance for your help.
Code:
Dim connectionString As String = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\[URL unfurl="true"]wwwroot\myapp\db2.mdb"[/URL]
Dim con As OleDbConnection
Dim cmd As OleDbCommand = New OleDbCommand
Dim da As OleDbDataAdapter
Dim ds As DataSet = New DataSet
Dim sSQL As String = "SELECT * FROM Employees" 'EXECUTE Instance_Records"
cmd.CommandText = sSQL
con = New OleDbConnection(connectionString)
con.Open() [COLOR=green]' <<<< THIS IS WHERE IT BOMBS[/color]
da = New OleDbDataAdapter(cmd)
da.Fill(ds)
con.Close()
dgResults.DataSource = ds
dgResults.DataBind()
Thanks in advance for your help.