Question: I'd like to read and write window registry in **window xp and 7** by using **vb6**. I'm not much strong in vb6. I tried this below 

```
Dim str As String
str = GetSetting("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines", "Text", "ImportMixedTypes")

```

My coding doesn't work. Please point out my missing.

Answer: 
You can't use `GetSetting` for that setting. That method is only for reading/writing configuration settings for your own application. If you want to read anywhere in the registry you have to use the Windows API function [RegOpenKeyEx](http://msdn.microsoft.com/en-us/library/ms724897%28v=vs.85%29.aspx) and friends.

Here's a Microsoft support article that explains how to do this (with sample code): [How To Use the Registry API to Save and Retrieve Setting](http://support.microsoft.com/kb/145679)

Note that you will have to have permission to read the relevant place in the registry, I'm not 
sure if you'll have access to that key so you'll have to try it out.
HKEY\_LOCAL\_MACHINE can cause permission problems. described in these article [Microsoft API article](https://support.microsoft.com/ru-ru/kb/145679)

procedures works well if you will change HKEY\_LOCAL\_MACHINE to CURRENT\_USER.