连接Access数据库的问题asp.net(C#)
程序如下:
string strConnection="Provider=Microsoft.Jet.OleDb.4.0;datasource=d:\\db1.mdb";
OleDbConnection objConnection=new OleDbConnection(strConnection);
Label1.Text=strConnection;
try
{
objConnection.Open();
Label2.Text="连接数据库成功";
objConnection.Close();
Label3.Text="数据库关闭";
}
catch(Exception a){
Label2.Text="连接失败";
Label3.Text=a.ToString();
}
给出的错误信息为: 连接Access数据库实例
Provider=Microsoft.Jet.OleDb.4.0;datasource=d:\db1.mdb
连接失败
System.Data.OleDb.OleDbException: 找不到可安装的 ISAM。 at System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) at System.Data.OleDb.OleDbConnection.InitializeProvider() at System.Data.OleDb.OleDbConnection.Open() at 实例7_2连接Access.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\实例7-2连接access\webform1.aspx.cs:line 32