Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA code to allow writing to file in c:\ in Vista?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Visa won’t allow accessing/storing a file on C:\ unless it’s READ-ONLY, so now we need to store our database file in the following path: c:\username\engl\engl.mdb (it used to be the pathname c:\engl.mdb).

We have a lot of VBA code that calls (Opens) the database in c:\engl.mdb in Windows XP (and Office XP). What’s the best VBA code to make this now work in Vista, given that the username will be changing as well? It would be great if we could do a simple Find/Replace on all the modules that reference c:\engl.mdb.

Thanks for any suggestions!

--Ray
 
the username will be changing as well
You may consider the Environ function:
strPath = "c:\" & Environ("username") & "\engl\engl.mdb"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top