"Pieter Linden" <pi********@hotmail.com> wrote in message
news:bf**************************@posting.google.c om...
"rkc" <rk*@yabba.dabba.do.rochester.rr.com> wrote in message
news:<WN*******************@twister.nyroc.rr.com>. ..
"Pieter Linden" <pi********@hotmail.com> wrote in message
news:bf**************************@posting.google.c om...
When I am convinced I have things right, I then do something many
in this ng say is a waste of time, I write DDL and run a script to
create the tables. Once you are familiar with the Jet dialect it's much faster
than point and click.
How do you do it? I have used the usual Oracle-like syntax, but not
so much Access... ie
CREATE TABLE MyTable(
Field1 dbText(20),
Field2 dbLong,
....)
I don't think the basics are much different.
A place to start is JetSQL40.chm or JetSQL35.hlp, which ever you
can find on your system.
Here's an example that creates the Order Details table found in the
NorthWind database (Access 2002 version, I think).
This was generated from a script so many of the Create Index
statements are redundant.
CREATE TABLE OrderDetails (
OrderID Long,
ProductID Long NOT NULL ,
UnitPrice Currency NOT NULL ,
Quantity Integer NOT NULL ,
Discount Single NOT NULL ,
CONSTRAINT pkOrderDetails PRIMARY KEY (OrderID,ProductID),
CONSTRAINT OrdersOrderDetails FOREIGN KEY (OrderID)
REFERENCES Orders (OrderID),
CONSTRAINT ProductsOrderDetails FOREIGN KEY (ProductID)
REFERENCES Products (ProductID)
)
Create Index OrderID
ON Order Details (OrderID);
Create Index OrdersOrder Details
ON Order Details (OrderID);
Create Unique Index PrimaryKey
ON Order Details (OrderID,ProductID)
WITH DISALLOW NULL;
Create Index ProductID
ON Order Details (ProductID);
Create Index ProductsOrder Details
ON Order Details (ProductID);