Hi all,
I'm creating an MS Access database and then adding a table. But I want one of the fields in this table to have a default value. Access allows this, but I cannot seem to programmatically set it. I'm using this code:
And then I'm using TADOCommand to issue a CREATE TABLE SQL command to create the table. But how to set a default value? Specifically, a date field with a default value of '=Now()'.
Thanks!
I'm creating an MS Access database and then adding a table. But I want one of the fields in this table to have a default value. Access allows this, but I cannot seem to programmatically set it. I'm using this code:
Code:
[b]var[/b]
x : OLEVariant;
[b]begin[/b]
x := CreateOleObject('ADOX.Catalog');
[b]try[/b]
x.Create('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=''newdb.mdb'';Jet OLEDB:Engine Type=4;');
[b]finally[/b]
x := Unassigned;
[b]end[/b];
[b]end[/b];
And then I'm using TADOCommand to issue a CREATE TABLE SQL command to create the table. But how to set a default value? Specifically, a date field with a default value of '=Now()'.
Thanks!