... string FilePath = FolderPath + "\\myDataBasae.accdb" +; if (!File.Exists(FilePath)) { File.Create(FilePath); OleDbConnection myConnection = new OleDbConnection(); myConnection.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source= " + FilePath; OleDbCommand myCommand = new OleDbCommand(); myCommand.Connection = myConnection; myCommand.CommandText = "CREATE TABLE myTable " + " (" + " ID int IDENTITY(1,1) PRIMARY KEY," + " Day DateTime," + " Events MEMO" + " )"; try { myConnection.Open();// This line raises an Exception myCommand.ExecuteNonQuery(); myConnection.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { myConnection.Close(); } }
Set objConnection = CreateObject("ADOX.Catalog") objConnection.Create _ "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = myDatabeest.mdb"
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)