Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Registry Class in Windows 7 and A2010

35 views
Skip to first unread message

The Frog

unread,
Apr 15, 2013, 12:14:52 AM4/15/13
to
Hi Everyone,

In the past I have used Ken Getz registry class (Win32Registry) to retrieve registry keys when I needed them. I am working now on an application in A2010 on a Win7 Ultimate 64 bit machine and have discovered that the class no longer functions.

Is anybody able to either point me at a replacement class module that I can use or perhaps make me aware of where I can find out the differences in how the registries work so that I can refactor the class to once again function?

The locations of the keys I am looking for seem to be the same but I am unable to see any sub keys even though they are there. Verified with regedit. The goal is to test for installed ODBC drivers, usually done by looking at SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers under local machine.

Might have a look and see if there is a WMI way to do this while I am at it, but any help with the above stated issue would be appreciated.

Cheers

The Frog

Phil

unread,
Apr 15, 2013, 4:38:10 AM4/15/13
to
On 15/04/2013 05:14:55, The Frog wrote:
> Hi Everyone,
>
> In the past I have used Ken Getz registry class (Win32Registry) to
> retrieve registry keys when I needed them. I am working now on an
> application in A2 010 on a Win7 Ultimate 64 bit machine and have
> discovered that the class no longer functions.
>
> Is anybody able to either point me at a replacement class module that I
> can use or perhaps make me aware of where I can find out the differences
> in ho w the registries work so that I can refactor the class to once again
> functi on?
>
> The locations of the keys I am looking for seem to be the same but I am
> una ble to see any sub keys even though they are there. Verified with
> regedit. The goal is to test for installed ODBC drivers, usually done by
> looking at SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers under local machine.
>
> Might have a look and see if there is a WMI way to do this while I am at
> it , but any help with the above stated issue would be appreciated.
>
> Cheers
>
> The Frog
>

Try
Function RegKeyExists(i_RegKey As String) As Boolean
'?regkeyexists("HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC
Drivers\SQL Server")

Dim myWS As Object

On Error GoTo ErrorHandler

'access Windows scripting
Set myWS = CreateObject("WScript.Shell")
'try to read the registry key
myWS.RegRead i_RegKey
'key was found
RegKeyExists = True
Exit Function

ErrorHandler:
'key was not found
RegKeyExists = False

End Function

This checks the SQL Server driver exixts. You may have to loop through to see
if the drivers you are looking for are thare

Phil

The Frog

unread,
Apr 16, 2013, 10:28:54 PM4/16/13
to
Hi Phil,

I have discovered something odd. When I look at the registry again now having had alittle more time, I can only see the SQL Server driver listed there. In Win7 64 bit there is another location that the drivers appear to be in which is different on two different machines I have looked at. This seems to be the case when using 32bit drivers on a 64bit machine - they work quite well by the way.

I am going ahead with the WMI approach as it appears to be 'bit' agnostic. I am also looking forward to building a class heirarchy which is something I havent done for a while. If I can get it to work I will put the code somewhere so it can be shared.

FWIW I am in the process of completely refactoring my framework codebase so that it is benefitting from all the things I have learned since I started dealing with Access. Its amazing how much better solutions you can see in your own work with the benefit of time. My goal in this case is to generate a class heirarchy that will stem from a single 'computer' class and simply provide heirarchical access to everything you could reasonably want either from your computer or your application. It'll take a while to be sure but I think the end result will be a much better code base to work from and maintain as well as performance improvements and stability. I will keep you posted.

Cheers

The Frog

Phil

unread,
Apr 18, 2013, 1:15:17 PM4/18/13
to
On 17/04/2013 03:28:56, The Frog wrote:
> Hi Phil,
>
> I have discovered something odd. When I look at the registry again now
> havi ng had alittle more time, I can only see the SQL Server driver listed
> ther e. In Win7 64 bit there is another location that the drivers appear
> to be i n which is different on two different machines I have looked at.
> This seems to be the case when using 32bit drivers on a 64bit machine -
> they work qui te well by the way.
>
> I am going ahead with the WMI approach as it appears to be 'bit' agnostic.
> I am also looking forward to building a class heirarchy which is something
> I havent done for a while. If I can get it to work I will put the code
> some where so it can be shared.
>
> FWIW I am in the process of completely refactoring my framework codebase
> so that it is benefitting from all the things I have learned since I
> started dealing with Access. Its amazing how much better solutions you can
> see in y our own work with the benefit of time. My goal in this case is to
> generate a class heirarchy that will stem from a single 'computer' class
> and simply provide heirarchical access to everything you could reasonably
> want either from your computer or your application. It'll take a while to
> be sure but I think the end result will be a much better code base to work
> from and main tain as well as performance improvements and stability. I
> will keep you pos ted.
>
> Cheers
>
> The Frog
>

Look forward to seeing what you are up to as I suspect a number og other ..
What's the collective noun for news group readers? groupies? Doesn't sound
right ... will be interested too.

Phil

The Frog

unread,
Apr 20, 2013, 4:10:50 AM4/20/13
to
Thankyou for the vote of confidence Phil. Work is progressing well so
far. It's a lot of refactoring old code, but I think it will be worth
it.

It is a royal pain working out all the WQL needed for so many little
things. Making the hierarchy play nicely is equally challenging.
Interesting pursuit. If I get it right it will make a fantastic
framework for applications. Trying to make it all event driven. I
want my apps to be aware of their environment and be able to adapt
accordingly. Especially when it comes to network connectivity. Got
that bit prototyped quite well.

--
Cheers

The Frog
0 new messages