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

Can I read other registry area by VBA?

Status
Not open for further replies.

snoooopy

Programmer
Aug 13, 2002
9
US

Dear All:

Did anybody know how to read the registry except "VB and VBA Program Settings". I want read ODBC user DSN information.

My point is what kind of database customer using in the runtime. So I can write 2 DIFFERENT statements to link Access or SQL Server by DAO.




 
Are you asking if you can read the registry on someone else's computer? I rather doubt that possible.

Rollie E
 
No, I just want read the local registry.

In VBA, we just can use SaveSetting(), GetSetting() to visit the HKEY_CURRENT_USER/Software/VB and VBA Program Settings/...
And such as the RegOpenEx() functions is NOT available.

So what can I do?
 
It is right that SaveSetting()/GetSetting() allow you only to access a certain part of the Registry. If you want to access the whole Registry, you can either use the (quite complicated) API calls or simply the WScript object (see Microsoft.com for the details).
 
Snoop,
Have a look at thread705-336569 where I give a set of functions for reading & writing to the registry.
Be careful though, it's easy to cause major problems by editing the registry.

B ----------------------------------------
Ben O'Hara
Home: bpo@SickOfSpam.RobotParade.co.uk
Work: bo104@SickOfSpam.westyorkshire.pnn.police.uk
(in case you've not worked it out get rid of Sick Of Spam to mail me!)
Web: ----------------------------------------
 
Thanks Ben.
I'm so appreciated your helps!

Have a nice day!
Jacky
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top