分类: WINDOWS
2011-11-26 11:38:35
strPath = "C:\\Documents and Settings\\Administrator\\My Documents\\Database1.accdb";
String strCon = "Provider=Microsoft.ACE.OLEDB.12.0;jet oledb:database password=123;Data Source=";
strCon += strPath;
OleDbConnection myCon = new OleDbConnection(strCon);
try
{
myCon.Open();
}
catch (Exception ex)
{
string s = ex.Message;
}
string strState = myCon.State.ToString();