Hi,
I'm new to VB6.
I have a project where I move the open Access 97 files across our network, then I compact & repair the MDF files.
I thought this code would work:
This part runs fine by itself:
And this part runs fine by itself:
But when I try to run the whole thing (above) I get the error:
"Runtime error 3159 - Not a valid bookmark"
I think I need to run the move part of my code first let it finish, and then do the compact part of my code later...but I don't know how to do that...(I'm using a click command button event)
Sorry I'm really new at this.
I'm new to VB6.
I have a project where I move the open Access 97 files across our network, then I compact & repair the MDF files.
I thought this code would work:
Code:
Private Sub Command1_Click()
Dim fso As New FileSystemObject
'
Code:
'fso.CopyFile "\\WSIPR2\GSAP\WSITES\TES.mdb", "\\GSDCSHR01\gsap\WSITes\TES.mdb"
' If Dir("\\GSDCSHR01\gsap\WSITes\TES2.mdb") <> "" Then Kill _
' "\\GSDCSHR01\gsap\WSITes\TES2.mdb"
'DBEngine.CompactDatabase "\\GSDCSHR01\gsap\WSITes\TES.mdb", "\\GSDCSHR01\gsap\WSITes\TES2.mdb"
'Kill "\\GSDCSHR01\gsap\WSITes\TES.mdb"
'Name "\\GSDCSHR01\gsap\WSITes\TES2.mdb" As "\\GSDCSHR01\gsap\WSITes\TES.mdb"
This part runs fine by itself:
Code:
'DBEngine.CompactDatabase "\\GSDCSHR01\gsap\WSITes\TES.mdb", "\\GSDCSHR01\gsap\WSITes\TES2.mdb"
Code:
'fso.CopyFile "\\WSIPR2\GSAP\WSITES\TES.mdb", "\\GSDCSHR01\gsap\WSITes\TES.mdb"
"Runtime error 3159 - Not a valid bookmark"
I think I need to run the move part of my code first let it finish, and then do the compact part of my code later...but I don't know how to do that...(I'm using a click command button event)
Sorry I'm really new at this.