I am attempting to update the initialization file that I use for my ACCESS database application. I identify it in the shortcut and use the SystemDB= line to strip off the location of the back-end database.mdb so that a ReAttach routine knows where to refresh the links to. This is done routinely whenever a new front-end is sent out.
As a result of new servers being installed and the systems engineers renaming the servers with a slighly different naming convention I just test for the ability to read a file at the old location and if unsuccessful then update the .ini file on the PC c:\winnt location with the new naming convention and trigger the reattachment routine.
Problem is I am having a hard time getting the Declaration and call to the function correct. I need a little help.
I want to change the underscore to a hyphen: -
What I have done so far:
Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpAppName, ByVal lpKeyName, ByVal lpString, ByVal lpFileName) As Long
Dim xReturnedIniWriteValue As Long
xReturnedIniWriteValue = WritePrivateProfileString("[Options]", "SystemDB", "\\GH9010-1\data\system.mdw", "app.ini")
After executing the above statement I get a Dr. Watson error and system crashes.
Anyone awake out there.