|
-
Mar 13th, 2002, 11:27 AM
#1
Thread Starter
Frenzied Member
Copy files (mdb)
Hi,
Somebody posted a while ago a method by which you can copy a .mdb file even if it is in use.
I can't find that thread.
Does anyone know how to do it?
-
Mar 13th, 2002, 11:52 AM
#2
I believe the CopyFile method of the FSO allows you to copy an open file. Very useful for backups when the db is open.
-
Mar 13th, 2002, 11:56 AM
#3
Fanatic Member
You can also use the CopyFile API function and avoid the bulky FSO.
VB Code:
Private Declare Function CopyFile Lib "kernel32" Alias "CopyFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long) As Long
Private Sub Form_Load()
CopyFile "C:\My Documents\Greenvil.mdb", "C:\My Documents\aaaa.mdb", True
End Sub
{Insert random techno-babble here}
{Insert quote from some long gone mofo here}
-
Mar 13th, 2002, 11:59 AM
#4
Thread Starter
Frenzied Member
Will the api function copy it even though it is open?
It's an mdb file.
Thanks a lot guys.
-
Mar 13th, 2002, 11:59 AM
#5
I'm aware of the CopyFile API but can find no documentation which states it will work on a file that is currently open. Does it?
-
Mar 13th, 2002, 06:51 PM
#6
Fanatic Member
Originally posted by vbgladiator
Will the api function copy it even though it is open?
It's an mdb file.
Thanks a lot guys.
Yes I tried it before I posted the solution.
{Insert random techno-babble here}
{Insert quote from some long gone mofo here}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|