Code to create access table

  • Thread starter Thread starter Allen Browne
  • Start date Start date
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top