L
Lisa
I had seen in a previous post that there was a site that could give
information on splitting a database and an update file that would create code
to deploy an updated front end when it has a different version than the main
front end. I am lost in one portion of the code, it is deleting the file
that it should be replacing. Here is my code: The main update file and the
main front end file is on is currently on a server, and I want to copy the
main front end file to the c: drive, and also make a backup copy on c:. Can
anyone see what it is that I am doing wrong?
Private Sub Form_Open(Cancel As Integer)
On Error Resume Next
' Update status form to identify version being copied.
strVer = DLookup("[VersionNumber]", "tblVersionServer")
Me.txtVer.Caption = "Installing version number ... " & strVer
' Load variables with correct file name-path values.
strMyDB = "\\plcicctf1\foliodev\workload\logs\Workload
04-Present\Update.mdb"
nPos = InStrRev(strMyDB, "\")
strPath = Mid(strMyDB, 1, nPos - 1)
strPath = strPath & "\workload.mdb"
strDest = Replace(strPath, "c:\workload\", "workload.mdb")
strBkup = Replace(strPath, "c:\workload\", "workload_backup.mdb")
' Stop processing here so article readers may step through code.
'Stop
' Create a backup (replacing existing backup if necessary) and
' remove the target file.
If Dir(strBkup) <> "" Then Kill strBkup
FileCopy strDest, strBkup
If Dir(strDest) <> "" Then Kill strDest
End Sub
information on splitting a database and an update file that would create code
to deploy an updated front end when it has a different version than the main
front end. I am lost in one portion of the code, it is deleting the file
that it should be replacing. Here is my code: The main update file and the
main front end file is on is currently on a server, and I want to copy the
main front end file to the c: drive, and also make a backup copy on c:. Can
anyone see what it is that I am doing wrong?
Private Sub Form_Open(Cancel As Integer)
On Error Resume Next
' Update status form to identify version being copied.
strVer = DLookup("[VersionNumber]", "tblVersionServer")
Me.txtVer.Caption = "Installing version number ... " & strVer
' Load variables with correct file name-path values.
strMyDB = "\\plcicctf1\foliodev\workload\logs\Workload
04-Present\Update.mdb"
nPos = InStrRev(strMyDB, "\")
strPath = Mid(strMyDB, 1, nPos - 1)
strPath = strPath & "\workload.mdb"
strDest = Replace(strPath, "c:\workload\", "workload.mdb")
strBkup = Replace(strPath, "c:\workload\", "workload_backup.mdb")
' Stop processing here so article readers may step through code.
'Stop
' Create a backup (replacing existing backup if necessary) and
' remove the target file.
If Dir(strBkup) <> "" Then Kill strBkup
FileCopy strDest, strBkup
If Dir(strDest) <> "" Then Kill strDest
End Sub