tags:

views:

356

answers:

5

I chave a db schema generated in a text file (DDL - MS Access compliant).

Where is the option in MS Acces to import that damn schema into na empry database ?

A: 

I'm not aware of any import for DDL.

However, DDL contains the definition for the schema.

You simply have the execute DDL as you would any query.

Either create a query, put it in sql mode, paste your ddl, and execute

or....

Create a VBA Sub to essentially do the same: currentdb.execute SQL

Good Luck

CMB
sorry - it doesn't work, only DML statments are supported in querries
lbownik
Not true about only DML -- Jet/ACE supports a limited set of DDL commands, certainly enough to create a schema from scratch, assuming compatible data types.
David-W-Fenton
A: 

To execute a SQL DDL in the SQL View of a Query object, you may need to change the Access user interface to ANSI-92 Query Mode. While the 'traditional' query mode (ANSI-89 Query Mode) supports a SQL DDL syntax it is very limited.

The Access database engine can only execute one SQL statement (DML, DDL or DCL) at a time. To execute a SQL script consisting of multiple SQL statement, you need something to parse individual SQL statements, so it really helps if your script has semicolon ; characters separating them, then execute each statement on at a time i.e. synchronously. If you are doing this in VBA code you are better off using ADO because it always uses ANSI-92 Query Mode.

onedaywhen
A: 

Is it possible to create the database using the DDL in something like SQL Server. Then import the database schema into Access?

Matthew Sposato
This is a new question, but the answer is YES. Assuming you have ODBC access to the SQL Server, just do FILE -> GET EXTERNAL DATA -> IMPORT and for FILES OF TYPE, choose ODBC (this assumes a DSN already exists). You can also EXPORT tables from Access/Jet to an ODBC database, which is quite convenient for doing the reverse.
David-W-Fenton
A: 

See if this helps: http://support.microsoft.com/kb/180841

Jeff O
A: 

I have been very succesful with reverse / forward engineering MS Access databases with Dezign for Databases by Datanamic. It reads all kinds of DDL scripts (from almost all available database) and can translate between different databases. There is a free trial available.

birger