How do I read a value from the registry?

B

Bob Valentine

I use SageKey to install my application and I have the user indicate the
location of the backend database file during the install on each
workstation. The installer then records the backend database location in the
following registry key: HKEY_LOCAL_MACHINE>software>MyApplicationName>Data
Directory. Data Directory is a key whose value is the full path to the
backend database.

Question: How do I read this value using VBA? What is the syntax of the
statement to read this registry key?

Thanks,
BobV
 
A

Alex Dybenko

hi,
it is a good idea to have path of BE stored in registry, next time you
install FE - you can automatically connect to BE file. I think this was the
idea of SageKey
Although - I never include a BE in application setup, user can try to
reinstall application and could overwrite backend.

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
 
R

Robert Valentine

Is there a way in VBA to read the registry key?

--
Cohee, Crisell & Co.
2199 E. Willow St.
Signal Hill, CA 90755-2099
562-595-0501
562-424-9867
(e-mail address removed)
www.coheecrisell.com
 
R

Robert Valentine

Thanks Doug.

I guess there is no easy VBA function that will read the registry key so I
will have to use API. The API code you referred me to will do what I want.

Thank you so much,
BobV

--
Cohee, Crisell & Co.
2199 E. Willow St.
Signal Hill, CA 90755-2099
562-595-0501
562-424-9867
(e-mail address removed)
www.coheecrisell.com
 
D

Douglas J. Steele

If you're going to be putting the value in the registry, you can use
SaveSetting to store it, and GetSetting to retrieve it. I forget off the top
of my head exactly where in the registry it gets put (but suspect it's
somewhere in HKCU)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top