rvermeulen
Member
Im trying to connect to an EMPLOYEES table in an XP Access DB. I was able to earlier connect to a different table and return data. However, when I try to create an OleDBDataAdapter and fill the Dataset to be used to bind to a datagrid, I get an: Unspecified Error: E_FAIL(0x8000405) exception.
Im not sure what Im doing wrong, seems pretty straightforward.
Here is the web.config file where I set my connection string:
<appSettings>
<add key="ConnectionString" value="Provider = Microsoft.jet.oledb.4.0;data source=c:\InetPub\wwwroot\ASPSample\ASPSample.mdb" />
Here is my code Im running in the Page_Load:
The code fails on the Fill statement. Can anyone please help me. Im having trouble figuring this out.
Thanks in advance.
Rick
Im not sure what Im doing wrong, seems pretty straightforward.
Here is the web.config file where I set my connection string:
<appSettings>
<add key="ConnectionString" value="Provider = Microsoft.jet.oledb.4.0;data source=c:\InetPub\wwwroot\ASPSample\ASPSample.mdb" />
Here is my code Im running in the Page_Load:
Code:
conn = New OleDb.OleDbConnection(ConfigurationSettings.AppSettings("ConnectionString")
Dim SQL as string = "select UserID, FirstName, LastName, Address, City, State, ZipCode, HireDate, Position from EMPLOYEES"
Dim empDA as new OleDB.OleDbDataAdapter(SQL, conn)
Dim ds as new DataSet()
empDA.Fill (ds, "employees")
EmployeeGrid.DataSource = ds.Tables("employees").DefaultView
EmployeeGrid.DataBind()
Thanks in advance.
Rick
Last edited by a moderator: