Ron,
This works excelent. Is there a web site where I can find moreSQL ddl
commands for Access or a tutorial on this subject?
Thx, for your advice.
Ludovic
"Ron Weiner" <rweineratworksritedotcom> wrote in message
There is an easier way. Access has a limited set of Sql DDL commands.
But what's there covers probably 90% of what most folks use.
Here are a few examples:
CREATE Table MyTable
(
MyID AutoIncrement CONSTRAINT MyIdConstraint PRIMARY KEY,
MyText CHAR(50),
MyByte BYTE,
MyInteger SMALLINT,
MyLong LONG,
MySingle SINGLE,
MyDouble DOUBLE,
MyDate DATETIME,
MyCurrency CURRENCY,
MyYesNo YESNO,
MyMemo MEMO,
MyOle OLEOBJECT,
MyBinary BINARY(100)
)
CREATE INDEX [IX_MyLong] ON [MyTable]([MyLong])
or
CREATE UNIQUE INDEX [IX_MyLong] ON [MyTable]([MyLong])
to make changes in an existing table.
ALTER Table MyTable
ADD COLUMN
NEWText CHAR(50),
NEWNum LONG,
NEWDate DATETIME
If what you need can not be done using access DDL queries than you are
stuck with ADOX or the native DAO Access stuff. There should be some
docs in the Access Help files, and undoubtly lot's more available on
the web.
Ron W
message Here are 2 links worth checking out
http://vbadud.blogspot.com/2007/11/create-database-with-ado-ado-create.html
http://groups.google.ca/group/micro...ms+access+vba+CreateTableDef#5fc4c0ad590a924b
--
Hope this helps,
Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples:
http://www.devhut.com/index.php
Please rate this post using the vote buttons if it was helpful.
:
Hi all,
Could someone point me a website where I can get some information and
examples on how to create tables with VBA code (ADO reference if
possible).
Thx,
Ludovic