Prechádzať zdrojové kódy

ACCESS数据库连接方式修改

Hcsy 7 rokov pred
rodič
commit
c7d1d24893
1 zmenil súbory, kde vykonal 4 pridanie a 2 odobranie
  1. 4 2
      UAS-MES/DataOperate/AccessDBHelper.cs

+ 4 - 2
UAS-MES/DataOperate/AccessDBHelper.cs

@@ -17,14 +17,16 @@ namespace UAS_MES.DataOperate
         public AccessDBHelper(string fileName)
         {
             this._fileName = fileName;
-            this._connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fileName + ";";
+            //this._connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fileName + ";";
+            this._connectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + fileName + ";";
         }
 
 
         public AccessDBHelper(string fileName,string password)
         {
             this._fileName = fileName;
-            this._connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fileName + ";Jet OLEDB:Database Password="+password+";";
+            //this._connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fileName + ";Jet OLEDB:Database Password="+password+";";
+            this._connectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + fileName + ";Jet OLEDB:Database Password=" + password + ";";
         }
 
         public void Open()