oops ... it's not quite so ... but thanks to mayayana for the
leads ...
The problem is that mayayana's code returns the same "false" for two
conditions: BOTH when the key is missing AND also when the key exists
but has no default value.
Google found a "real" solution, which actually checks only for the
existence of a key. At
http://www.dbforums.com/archive/index.php/t-938413.html
Here's a function that tests for key existence using RegRead that
*may* be
language-independent.
Function KeyExists(ByVal RegKey)
On Error Resume Next
Dim Shell
Dim Description
Set Shell = CreateObject("WScript.Shell")
Shell.RegRead "HKEYNotAKey\"
Description = Replace(Err.Description,"HKEYNotAKey\","")
Err.Clear
RegKey = Replace(RegKey & "\","\\","\") Shell.RegRead RegKey
KeyExists = Description <> Replace(Err.Description,RegKey,"")
End Function
This appears to work in the way I need - checking ONLY whether or not
the KEY exists (and ignoring whether it has values or not)