Solved

Copy database

Posted on 1998-06-11
4
147 Views
Last Modified: 2010-05-03
How to create new access database, and put in it records from Data Control recordset (backup of database). Shall you give my full procedure (with comments).
0
Comment
Question by:beciakk
4 Comments
 
LVL 7

Expert Comment

by:kamall
ID: 1463158
Since you intend to make a backup copy of the database, then the simplest and fastest way is to use the FileCopy statement:
FileCopy SourceFile, DestinationFile
Both SourceFile and DestinationFile are the full path/filename of the source and destination files.
Make sure that the database is closed before copying it.
Regards
0
 

Expert Comment

by:susmita
ID: 1463159
Since you want to backup you must be having a data control for the existing databse, make this into a control array. ie. if the name of the datacontrol is DataControl1,make the index propertity as 0 and use the following code

Load DataControl1(1)
and set the required properties like the connection,databse etc.
Hope this helps

0
 

Author Comment

by:beciakk
ID: 1463160
kamall:
You forget, that the database file is opened by Data Control and I can't close it and open (maybe you can help :-).

susmita:
So good, so far, but I don't know how to do it (Help me)

Thank you
0
 
LVL 2

Accepted Solution

by:
richtsteig earned 50 total points
ID: 1463161
Use the CreateDatabase method
to create a new database and then
run the

SELECT
INTO <newtable>
IN 'your new database'
FROM <oldtable>

statement in your original!
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

Suggested Solutions

Title # Comments Views Activity
vba find the last empty column 10 88
Need VBS version of Excel date conversion 4 64
change vba from autofit to 13.5 width? 4 28
vbModal 12 34
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

911 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

20 Experts available now in Live!

Get 1:1 Help Now