
Signature
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.
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
> Here are 2 links worth checking out
>
[quoted text clipped - 9 lines]
>> Thx,
>> Ludovic
Vsn - 25 May 2008 02:44 GMT
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
> 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.
[quoted text clipped - 51 lines]
>>> Thx,
>>> Ludovic
Ron Weiner - 25 May 2008 03:14 GMT
Google is your friend. http://www.google.com/search?hl=en&q=access+ddl
First few results look to be promising. Is there something in particular
you are looking for/
Ron W
> Ron,
>
[quoted text clipped - 60 lines]
>>>> Thx,
>>>> Ludovic
Vsn - 26 May 2008 12:30 GMT
I do agree on google, but you need to know what your looking for. in this
case i had no idea about an SQL ddl. Beside that, in this news group there
are some MVP who realy have excelent solutions from which i tent to learn
alot.
What I was looking for, further on your answer is, how to define the default
format and value in lets say a date field. Surly when I did manage that I
will come up with a new idea or question on the subject, thats why I asked
if there was some info on the net covering the topic.
I will take a look at the pages google comes up with.
Thx,
Ludovic
> Google is your friend. http://www.google.com/search?hl=en&q=access+ddl
> First few results look to be promising. Is there something in particular
[quoted text clipped - 65 lines]
>>>>> Thx,
>>>>> Ludovic
Ron Weiner - 26 May 2008 15:15 GMT
I do not believe that Access DDL supports default values. At least I was
unable to find a DDL statement that would allow me to set the default value
of a DateTime field to Now(). The Syntax to do this in using T-Sql in Msft
Sql Server would be:
ALTER Table MyTable ALTER COLUMN mydate CONSTRAINT AddDateDflt DEFAULT
getdate()
However this and many variants that I tried do not work in Access.
Msft's site for Access DDL ( http://support.microsoft.com/kb/180841 ) makes
no mention of Default Values.
This appears to be the 10% of the time that you'll have to rely on DAO or
ADOX.
Ron W
>I do agree on google, but you need to know what your looking for. in this
>case i had no idea about an SQL ddl. Beside that, in this news group there
[quoted text clipped - 80 lines]
>>>>>> Thx,
>>>>>> Ludovic
Jan Baird - 27 May 2008 20:52 GMT
Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
Jan Baird - 27 May 2008 20:51 GMT
Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
Jan Baird - 27 May 2008 20:51 GMT
Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
Jan Baird - 27 May 2008 20:51 GMT
Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.