OpenCurrentDatabase & networks

Noel

Registered User.
Local time
Today, 02:04
Joined
Apr 13, 2007
Messages
61
If you are deploying a pair of dbs with the code similar to below that toggles back and forth to the dbs, how would you set the strPath to take into account the dbs will be physically located on a network file server?

Option Explicit
Option Compare Database

Public appAccess As Access.Application

Public Sub OpenADatabase()
Dim strPath as string
set strPath = "C:\REVISION\dbBackend.mdb"
Set appAccess = CreateObject("Access.Application")

With appAccess
.OpenCurrentDatabase strPath
.Visible = True
End With

End Sub
 
You don't need the Set keyword for setting a string variable, but for the network, you would use UNC:

strPath = "\\YourServerNameHere\YourShareNameHere\TheFolderHere\YourFile.mdb"
 
thanks and...

I'll give it a try today.

I will also have linked tables between dbs. My guess is that the linked table manager should take care of it.

Noel
 
My guess is that the linked table manager should take care of it.
If you want, in the linked table manager you can use UNC, but you will need to just type it out (including the file name) and then copy it if it prompts you for it more than once but you would put it in the file name area:

02UNC.png
 
thanks bob

I incorporated the UNC path format for the fso copy method, the opencurrentdatabase method, and the linked tables that I'm using. So far, I'm in great shape.

I'm considering running make table queries and creating the tables in an outside db and I imagine the UNC path is the way to go too..

I appreciate your help.

Noel
 

Users who are viewing this thread

Back
Top Bottom