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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using $ in String

Status
Not open for further replies.

GummowN

Programmer
Jul 26, 2002
157
GB
This is another good one for you all to think about.

To make my life easier I have a public const in a database that is a network or local path.

I use this as the root for all files for the database. All I have to do is change the public const to move the database from dev to live.

However, the live is a hidden directory \\SERVER\APP$\INVENTORY

If I set the public const to this it unsurprisingly errors. Any ideas how to circumnavigate this feature?
 
Why unsurprisingly? I've just tried
Public Const ServerName As String = "\\SERVER\APP$\INVENTORY"

and had no problems.
How are you declaring it and what error message do you get?

Ben

----------------------------------------------
Ben O'Hara "Where are all the stupid people from...
...And how'd they get so dumb?"
rockband.gif
NoFX-The Decline
----------------------------------------------
 
Not sure if I have understood the question but I am thinking the problem is with $ in the name.

Have you tried the VBA.Chr(36) version of the character?
 
Hmmmmm

Really not sure why, but it appeared to be case sensitive!!!!

I changed the path to the correct case (ie pasted from explorer) and it worked.

Otherwise it was coming back with error 52:

Bad file name or number
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top