Code to create access table

A

Allen Browne

There are several ways to do this.

The most comprehensive is to use DAO. For examples, see help on
CreateTableDef(), CreateField(), CreateProperty(), etc. This lets you create
any type of field and property you would want to. There are a few things
such as the Decimal field type that you cannot create with DAO, but those
things generally don't work properly anyway.

Another alternative is to use a Data Definition Language query, such as:
CREATE TABLE Table1 (MyID COUNTER CONSTRAINT PrimaryKey PRIMARY KEY);

A third alternative is to use the ADOX library. Not recommended: many bugs,
and differences between versions.
 
M

Mohamed Hussein Mohamed

I am trying to create access table by typing several lines of code, please
helpe if this is possible and the way name the fields and give them suitable
field type.

Many thanks


mhussein
 
Top