Solved

Scripting databases (100 pts)

Posted on 2000-03-24
5
131 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

705 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

22 Experts available now in Live!

Get 1:1 Help Now