Copy database

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).
beciakkAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
richtsteigConnect With a Mentor Commented:
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
 
kamallCommented:
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
 
susmitaCommented:
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
 
beciakkAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.