D
Dave
I'm using the following code to add tables to an access database,
chkTables = new OleDbConnection( "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=|DataDirectory|\\test.mdb" );
chkTables.Open();
string commandString = "CREATE TABLE Payments_Commis (ID Guid
Primary Key, Pay_Date DateTime, Company_no Text (255), Ab Long, Description
Text(255), Amount DOUBLE )";
OleDbCommand commMake = new OleDbCommand(commandString,
chkTables);
commMake.ExecuteNonQuery();
This works fine, but I would like to know how to add a AutoNumber field, and
how to set the double field Amount to 2 decimal places. The folowing does not
work
string commandString = "CREATE TABLE Payments_Commis (ID Guid AutoNumber,
Pay_Date DateTime, Company_no Text (255), Ab Long, Description Text(255),
Amount DOUBLE (2))";
both give errors.
chkTables = new OleDbConnection( "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=|DataDirectory|\\test.mdb" );
chkTables.Open();
string commandString = "CREATE TABLE Payments_Commis (ID Guid
Primary Key, Pay_Date DateTime, Company_no Text (255), Ab Long, Description
Text(255), Amount DOUBLE )";
OleDbCommand commMake = new OleDbCommand(commandString,
chkTables);
commMake.ExecuteNonQuery();
This works fine, but I would like to know how to add a AutoNumber field, and
how to set the double field Amount to 2 decimal places. The folowing does not
work
string commandString = "CREATE TABLE Payments_Commis (ID Guid AutoNumber,
Pay_Date DateTime, Company_no Text (255), Ab Long, Description Text(255),
Amount DOUBLE (2))";
both give errors.