Link to home
Get AccessLog in
Avatar of JeePeeTee
JeePeeTee

asked on

Poor DDL support in Microsoft access…

Poor DDL in Microsoft access…

Why can’t I use this DDL?

create table Currency
(
    CurCode              Text(3)         not null,
    CurName             Text(35),
    Memo                 Memo,       
constraint PK_CURRENCY primary key (CurCode)
);

The table name currency is not allowed within DDL and also the column name memo is not accepted. When I change those names into CCurrency and Memo into Comment, I can execute the DDL. When I enter into designer mode I can change those names back into Currency and Memo again. Why the difference between DDL and a real hand job?

Also cascade delete and update can not be defined within DDL?

Any work around?
Avatar of Steve Bink
Steve Bink
Flag of United States of America image

Currency and Memo are reserved words for those data types.  You should always avoid using those names as field names.  The best result is confusion when you look at the code; the worst, a crash.

Is there a reason you need to do this using DDL?
Avatar of JeePeeTee
JeePeeTee

ASKER

Hello Routunet...

Yes I make use of Power Designer from where I generate the database. This is also the place where I design and modify the defintions. This tool can make DDL scripts or generate the database by an ODBC connection and generates it on the fly!

handy tool indeed!  Have you tried using the ODBC method?  Does this present the same problems?

I'll admit, I'm not familliar with DDL at all, but ODBC I can do, and it meshes with ADO constructs inside Access as well.
ODBC uses DDL and shows the same problems and limitations.

Strange enough, when you make use of the access designer, you can rename the table back into currency and the field back into memo.
ASKER CERTIFIED SOLUTION
Avatar of Steve Bink
Steve Bink
Flag of United States of America image

Link to home
membership
This content is only available to members.
To access this content, you must be a member of Experts Exchange.
Get Access
I have found that if you put brackets around table/field names, you can get away with a lot in Access and SQL Server.  

Just my two cents worth...maybe only a penny.

Thanks,
Mike