|
-
Jun 27th, 2002, 01:28 PM
#1
Thread Starter
Lively Member
FileCopy Mystery
My application has 14 mdb files and I am writing a backup routine. Using filecopy,sourcefile,destinationfile in the routine. 13 of the files copy and on one I get the error message "permission denied".
I have checked for any differences in file structure and attributes, none. Have gone to DOS and copied. Copied the file to a different name and then copied back with no difference in result.
Any thoughts on what could be happening?
Thanks again, and again to all you experts.
Sometimes to get what you want, you must give up what you have.
-
Jun 27th, 2002, 01:33 PM
#2
Addicted Member
Could it be in use by another program?
What is the answer to this question?
-
Jun 27th, 2002, 01:41 PM
#3
Thread Starter
Lively Member
Sometimes to get what you want, you must give up what you have.
-
Jun 27th, 2002, 02:37 PM
#4
One thought one question.
Question: Can you copy the database from one place to another using the standard copy from Windows Explorer?
Thought: Try using VB's SetAttr to ensure the Db's propertys are set only to Archive.
-
Jun 27th, 2002, 04:44 PM
#5
Thread Starter
Lively Member
Reply
If I eliminate the FileExists call then the file will copy.
If FileExists("cdata.mdb") Then
frmBusiness.txtBusinessName = frmCompany.txtCompany
End If
Public Function FileExists(ByVal FileName As String) As Boolean
FileExists = ((Len(FileName) > 0) And (Len(Dir$(FileName)) > 0))
End Function
There is a data control on frmCompany using cdata.mdb.
If this action opens the file, how do I close.
Thanks.
Sometimes to get what you want, you must give up what you have.
-
Jun 27th, 2002, 05:31 PM
#6
Addicted Member
Here's another method that you could use.
Dim F As File, FSO As New FileSystemObject
Dim S as string
S = "C:\Test.txt"
If FSO.FileExists(S) Then
Set F = FSO.GetFile(S)
F.Copy "C:\CopyTest.txt", True
End If
That which does not kill us, only makes us stronger. 
-
Jun 27th, 2002, 05:53 PM
#7
Thread Starter
Lively Member
Try again
My question was, "if the following opens the file, how do I close"
frmBusiness.txtBusinessName = frmCompany.txtCompany
(frmCompany has a data control tied to cdata.mdb)
Sometimes to get what you want, you must give up what you have.
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
|