This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: I didn't get registry value. What is wrong in my code ?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 30, 2012
11:19 AM
I didn't get registry value. What is wrong in my code ?
Hi, community.
My function returns empty value for my registry key.
This is the records in my registry
[CODE]
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\\SOFTWARE\\ORACLE\\ODP.NET\\4.112.3.0]
"DllPath"="C:\\Oracle\\product\\11.2.0\\bin"
"TraceFileName"="C:\\odpnet4.trc"
"TraceLevel"="0"
"TraceOption"="0"
"SelfTuning"="1"
"MaxStatementCacheSize"="100"
"DemandOraclePermission"="0"
"PerformanceCounters"="0"
"PromotableTransaction"="promotable"
"StatementCacheWithUdts"="1"
"UdtCacheSize"="4096"
[/CODE]
What is wrong in my code?
My function returns empty value for my registry key.
function CheckOracleVersion()
STRING szFile;
STRING szDllLocation;
STRING szVersion;
NUMBER nvSize;
INT result;
INT nvType;
begin
nvSize = MAX_PATH;
nvType = REGDB_STRING;
if (RegDBGetKeyValueEx ("\\HKEY_LOCAL_MACHINE\\SOFTWARE\\ORACLE\\ODP.NET\\4.112.3.0", "DllPath", nvType, szDllLocation, nvSize)< 0) then
SprintfBox(INFORMATION, "RegDBGetKeyValueEx failed", "RegDBGetKeyValueEx failed");
endif;
szFile = szDllLocation + "\\" + "oraclient11.dll";
result = VerGetFileVersion (szFile, szVersion);
end;
This is the records in my registry
[CODE]
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\\SOFTWARE\\ORACLE\\ODP.NET\\4.112.3.0]
"DllPath"="C:\\Oracle\\product\\11.2.0\\bin"
"TraceFileName"="C:\\odpnet4.trc"
"TraceLevel"="0"
"TraceOption"="0"
"SelfTuning"="1"
"MaxStatementCacheSize"="100"
"DemandOraclePermission"="0"
"PerformanceCounters"="0"
"PromotableTransaction"="promotable"
"StatementCacheWithUdts"="1"
"UdtCacheSize"="4096"
[/CODE]
What is wrong in my code?
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 30, 2012
02:02 PM
If you have not, please refer to RegDBGetKeyValueEx.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 01, 2012
12:52 AM
Try removing the '\\' before HKEY_LOCAL_MACHINE...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 01, 2012
08:34 AM
The general problem was, I think, with defined by default RegDBSetDefaultRoot.
This is the working code:
This is the working code:
function CheckOracleVersion()
STRING szFile;
STRING szDllLocation;
STRING szVersion;
STRING szRegistry;
STRING szKey;
STRING szNumValue;
NUMBER nvSize;
INT result;
INT nvType;
NUMBER nRootKey;
begin
nvSize = MAX_PATH;
nvType = REGDB_STRING;
szDllLocation = "";
szKey = "DllPath";
nRootKey = HKEY_LOCAL_MACHINE;
result = RegDBSetDefaultRoot (nRootKey);
szRegistry = "SOFTWARE\\ORACLE\\ODP.NET\\4.112.3.0";
if (RegDBGetKeyValueEx (szRegistry, szKey, nvType, szDllLocation, nvSize)< 0) then
SprintfBox(INFORMATION, "RegDBGetKeyValueEx failed", "RegDBGetKeyValueEx failed");
endif;
szFile = szDllLocation + "\\" + "oraclient11.dll";
result = VerGetFileVersion (szFile, szVersion);
end;