Copy db in AutoExec prevents MDE being created

W

Winshent

My code below is called by auto exec and copies the file from the
shared drive to a users local drive. All works fine in mdb mode, but i
cannot compact the mdb and cannot convert to mde. It will only
compact/convert if i rem the code out..

Is there a solution to this? I'm using Access 2003.

##############################################################
Sub CopyToLocal

Const q As String * 1 = """"
Dim DestPath As String
Dim SourcePath As String
Dim strUpdateTool As String

DestPath = DLookup("[DestinationPath]", "tblConfig")
If CurrentProject.Path <> DestPath Then

If FileExists(DestPath) & CurrentProject.Name) Then
DeleteFile (DestPath & CurrentProject.Name)
end if

If Not FolderExists(DestPath) Then
CreateFolder (DestPath)
end if

CopyFile CurrentProject.Path, DestPath, CurrentProject.Name
strUpdateTool = "MSAccess.exe " & q & DestPath & CurrentProject.Name
& q

Shell strUpdateTool, vbNormalFocus
End Sub
##############################################################
 
W

Winshent

Aaron

Thanks for the response.. it appears to be now working!! so i assume
nothing wrong with my code..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top