Link to home
Start Free TrialLog in
Avatar of LenkaL
LenkaLFlag for United States of America

asked on

To find an INI file from Access

Hello,

I have a simple code in my Access DB to get or write to the ini file.
-----------------------------------------------------------------------------------------
Function GetIniEntrySettings(strSection As String, strEntry As String) As String

    GetIniEntrySettings = GetSetting("Sample", strSection, strEntry, "")
   
End Function
---------------------------------------------------------------------------------------------

But I don't know how to find that INI file! How can I locate that INI file?
I didn't create that DB and need to find that ini file. Code doesn't define or declare
any INI files. Is there some settings in the MDB file I can check?
Is there a defualt folder that ini files sit?

So to summarize - how can I find the ini file that my code talks to.
Avatar of jerryb30
jerryb30
Flag of United States of America image

What ini file?  What program?  What version of Access?  What OS?

Most of your default settings, as would be set in Tools, Options, would now be stored in your system registry.  
GetSetting queries the Windows registry, not an INI file.
In Access 2002, ini files are used only on MacOS. I don't know where to look for it, but here are some pointers:

    ? DBEngine.IniPath
    Software\Microsoft\Office\11.0\Access\Jet\4.0

This shows the registry path on Windows. Perhaps it will show the path to the ini file on a MacIntosh? You also have:

    ? SysCmd(acSysCmdIniFile)
    msacc30.ini

This could also be a clue. If you are looking for custom ini files, the switch /profile superseded the old /ini switch. But again, is that only Windows?

Finally, it's probably that the function you show is merely a wrapper added when upgrading from Access 97 or earlier. Have you looked into the registry under this key:

HKEY_CURRENT_USER\Software\VB and VBA Program Settings\Sample\...

(°v°)
Avatar of LenkaL

ASKER

>>GetSetting queries the Windows registry, not an INI file.

That is close to what is happening. I did find those settings in registry on another machine.
How can I copy those settings onto my machine?

When GetSettings runs on my machine it obviously returns nothing.
Is there some script I can write just to copy those settings?
ASKER CERTIFIED SOLUTION
Avatar of harfang
harfang
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial