Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21843

I think this is easy on for you guys

$
0
0
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:

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"
And this part runs fine by itself:

Code:

'fso.CopyFile "\\WSIPR2\GSAP\WSITES\TES.mdb", "\\GSDCSHR01\gsap\WSITes\TES.mdb"
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.

Viewing all articles
Browse latest Browse all 21843

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>