Solved

Scripting databases (100 pts)

Posted on 2000-03-24
5
132 Views
Last Modified: 2010-05-18
I've posted a question on the VB/Databases forum that someone might be able to help with here. 100pts on offer.

Basically I want to write code that will generate a database "on the fly", ie create all the tables, querydefs and relationships to replicate an existing database that I have.
If you can give me an example, or even better know of any tools to help, please see the Q below :

http://www.experts-exchange.com/jsp/qShow.jsp?ta=vbdatabases&qid=10316718 
0
Comment
Question by:paulstamp
  • 2
  • 2
5 Comments
 
LVL 3

Expert Comment

by:jjmartin
ID: 2653853
This might help, it goes over all the functions you might ever use for ADO and DAO database access.  The last few pages cover creating tables, queries, making things replicable... etc.

http://www.microsoft.com/data/ado/adotechinfo/dao2ado.htm
0
 
LVL 1

Expert Comment

by:jonder
ID: 2656674
The database that you want to replicate do you want the data that is inside the Tables as well, or do you just want a replicated empty database?

What type of database Access, SQL, dBase, ...?
0
 
LVL 1

Accepted Solution

by:
jonder earned 5 total points
ID: 2656682
Sorry I just went to your link and read the question.

But what I have done in the past is changed the Database name ie. MSAccess.mdb to {anyname}.dll and placed it in the System directory.
When I needed to create a new database I simply copied the template over to the destination directory renamed to Whatever.mdb.


0
 
LVL 3

Author Comment

by:paulstamp
ID: 2659775
Adjusted points from 0 to 5
0
 
LVL 3

Author Comment

by:paulstamp
ID: 2659776
jonder... not a bad idea, unfortunately samopal and morpho have both provided solutions that let me do it in code.

Thanks anyway.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now