-
I have a constant
Public Const gDataBaseName = "\\SRVR\shares\Action Request\Action Requestcon.mdb"
This is where my Database resides. The problem is if the database moves I will have to go in and change code. To not have to do this I added an .ini file that I can change from within the program. How do I reasign that Constant to the new Variable? I need a constant because through out the program it is being called.
Any comments would be appreciated
Thanks Troy
-
You can't reassign constant. You'd need to use a public or global variable for this purpose.
Paul
-
You need to do this through API calls. You should also really be using the Registry by now.
I can't remember the Registry API's but do a search for GetProfileString (the API to recall data from an .INI file) or WriteProfileString on the Microsoft site. That might be a good point to start. www.vbapi.com is very good as a complete reference to API calls, but you need to have at least an idea of what it's name is.
Cheers,
P.
-
Sorry paulw
You must have miss-understood.. I know how to read and write to ini's and the registry I was just lookin to see if anyone had a way to reasign a constant to a new value. If you want to know how to write to the registry follow this link
http://www.planetsourcecode.com/xq/A...s/ShowCode.htm