View Full Version : UNC path in Code


Blkblts
02-08-2001, 05:55 AM
I have a database that is split. currently they both are in G:\projects\

I need to move the backend database to a production drive I:\. The front end will be on a local PC.

Here's my question... In a few of the forms I need to write information to a table in the backend database using the With statement. In my openrecordset I have G:\projects\hm.mdb listed. I want to know can I use a unc path of \\ or something like that so I don't have to look through all my code and change all the paths if I move the back end to a different place?

Thanks
Kim

marieves
02-08-2001, 06:55 AM
Store 'G:\projects\hm.mdb' as a global constant in a module, and you will only need to change it once.

eg: place in a module
Global Const strDbLocation As String = "G:\projects\hm.mdb"






[This message has been edited by marieves (edited 02-08-2001).]

Pat Hartman
02-08-2001, 05:32 PM
Changing to using the unc path wouldn't help you if you moved the back end. You'd still have the same problem. What using the unc path does for you is to eliminate the problem of hard coded drive mappings that could be different on each user machine.