Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table scripts in MSAccess

Status
Not open for further replies.

Ajb2528

Technical User
Feb 22, 2002
270
GB
Hi!!

Is there any way of exporting (to a text file or VBA code) the definitions of Access tables (with the index and primary key definitions) so that they can be re-imported back into another mdb? This is an easy task within SQL Server but I have not found a way of doing this within MSAccess.

Any help would be appreciated!!

Regards,

Alan
 
I don't see why you need to use a text file or VBA code. What's wrong with the Import and Export functions in Access?
 
The idea with Access is you create tables via the Access GUI. There are no creates in source form if you do that.

Jet holds catalogue information as collections so you could write a VBA program to read the collections and generate creates but, as DrSimon says, you don't need to.

 
Because I want to use a script to export all of the table definitions and if and when they are needed create changes to the script and run it to create tables and the associated indexes and primary keys, much in the same way you can with SQL Server.

Regards,

Alan
 
Of course all of the tools exist in VBA to generate (create) tables, indexes, etc as well as documenting the existing ones, and at least a reasonable start on the how to is found under the ubiquitous {F1} (aka HELP!). see, as ONE example "CreareTable" and follow through the 'see also' topics.




MichaelRed
mlred@verizon.net

 
Alan
If you're talking about Generating CREATE scripts in Enterprise Manager, I'm not aware of anything similar in Access - you have to do it from scratch. I don't think we're clear where you are coming from. It sounds like you have SQL server experience and are now looking at Access but not what you want to do in Access. You can retain the data tables in SQL server and use Access as a front end if that would help.
Simon Rouse
 
Basically what I want to do is to export all of the table definitions/indexes etc from an existing Access mdb and then use this as a script to generate/modify another mdb.
 
If you want to go from one Jet database to another, Access does this for you. Access isn't some everyday run-of-the-mill dbms. It's the leader of the pack.

Why do you want to have a dog and bark yourself?[wink]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top