How can I import a database schema into MS Access 2003 from sql text file?

大憨熊 提交于 2019-12-25 03:49:20

问题


I have a database schema generated in a text file (DDL - MS Access compliant).

Where is the option in MS Access to import that schema into an empty database ?


回答1:


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




回答2:


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.




回答3:


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




回答4:


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.



来源:https://stackoverflow.com/questions/1153471/how-can-i-import-a-database-schema-into-ms-access-2003-from-sql-text-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!