UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> ON OPEN: Copy database over another    
 
   
col
post Mar 26 2005, 03:31 PM
Post #1

UtterAccess Veteran
Posts: 374



Everyone,

is there a way programically to copy a database over another?
Go to the top of the page
 
+
col
post Mar 26 2005, 04:44 PM
Post #2

UtterAccess Veteran
Posts: 374



I'm trying to use this code to make a backup copy of the database when it opens, but get a permission denied error. Both files exist. I want to overwrite the database_backup.mdb each time the database opens or when specified by the user. please help. thanks.

Function CopyDB()
Dim Location As String
Dim FileName As String
Dim BackupFileName As String

Location = "C:\Program Files\Database"
FileName = "database.mdb"
BackupFileName = "database_backup.mdb"
FileCopy Location & "\" & FileName, Location & "\" & BackupFileName

End Function
Go to the top of the page
 
+
r_cubed
post Mar 26 2005, 05:48 PM
Post #3

UtterAccess VIP
Posts: 3,752
From: Australia (NSW)



Look at the KILL command (which will 'kill' your exisitng backup) BEFORE doing the FileCopy
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 18th May 2013 - 11:11 AM