Solved

Scripting databases (100 pts)

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…

770 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