当前位置:编程学习 > C#/ASP.NET >>

access 打开数据库连接错误,未指定的错误

--------------------编程问答-------------------- 没有用户名和密码吗? 用的时候及时关闭了吗?你换个盘符试试。放在D盘

(1)無數据庫密碼時(有沒有用戶密碼該方法都可以),這种方式以共享方式打開.
OleDbConnection dbconn=new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data source=D:/Testdb.mdb;");
(2)有數据庫密碼時(有沒有用戶密碼該方法都可以),這种方式以獨占式方式打開.
OleDbConnection dbconn = new OleDbConnection(@"Provider=Microsoft.Jet.OleDB.4.0;Data Source=D:/Testdb.mdb;Jet OleDb:DataBase Password=12345");
(3)在數据庫密碼和用戶密碼都有時,可以用該方法,但用戶密碼處就算設有密碼也必須為空,這种方式也將以獨占式方式打開.
OleDbConnection dbconn = new OleDbConnection(@"Provider=Microsoft.Jet.OleDB.4.0;Data Source=D:/Testdb.mdb;Jet OleDb:DataBase Password=12345;Persist Security Info=true;password=;user id=Admin");
--------------------编程问答-------------------- 客户现场反馈说重启IIS就可以了,唉,只能等下次出问题了再试试了。。 --------------------编程问答-------------------- B/S程序读取没有问题,C/S还是报错。 --------------------编程问答-------------------- Server Error in '/' Application.
--------------------------------------------------------------------------------

打开数据库连接错误:未指定的错误 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Exception: 打开数据库连接错误:未指定的错误

Source Error: 


Line 56:         Leading.Data.DataADOConn dataconn = new Leading.Data.DataADOConn(DataAccessType.OLEAccess, cnnString);
Line 57:         DataSet ds = new DataSet();
Line 58:         dataconn.DB.GetDataSetFromExcuteCommand("select * from LCP_Project", "table1", null, ref ds);
Line 59: 
Line 60:         string showValue = ds.Tables[0].Rows[0]["ProjectID"].ToString()+"\\n";
 

Source File: d:\soft\MIS40\site\ImportTest.aspx.cs    Line: 58 

Stack Trace: 


[Exception: 打开数据库连接错误:未指定的错误]
   Leading.Data.DataExchange.DataAccess.Factory.ThrowDbError(Exception exp) +219
   Leading.Data.DataExchange.DataAccess.OleAccess.GetDataSetFromExcuteCommand(String SelectCommandString, String TableName, IDataParameter[] Paras, DataSet& ds) +210
   LeadingGH_ImportTest.Button2_Click(Object sender, EventArgs e) in d:\leadingsoft\MIS40\site\ImportTest.aspx.cs:58
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053 
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,