Databases Reference
In-Depth Information
lpcbData As Long) As Long
Private Sub ListDPs( )
' Search the registry for Data Providers
Const BUF_LEN As Long = 2048
Dim lret As Long, lret2 As Long, lret3 As Long
Dim hCLSIDKey As Long, hClassKey As Long, hClassSubKey As Long
Dim lbufKeyName As Long
Dim bufKeyName As String * BUF_LEN
Dim lbufClassName As Long
Dim bufClassName As String * BUF_LEN
Dim lbufKeyName2 As Long
Dim bufKeyName2 As String * BUF_LEN
Dim lbufClassName2 As Long
Dim bufClassName2 As String * BUF_LEN
Dim lbufValue As Long
Dim bufValue As String * BUF_LEN
Dim ft As FILETIME, ft2 As FILETIME
Dim lxKey As Long, lxKey2 As Long
Dim lValueType As Long
Dim bProvider As Boolean
Dim sDPs As String
Dim sName As String
' --------------
' Open CLSID key
' --------------
lret = RegOpenKeyEx(HKEY_CLASSES_ROOT, "CLSID", 0, KEY_READ, hCLSIDKey)
If lret <> ERROR_SUCCESS Then
MsgBox "Cannot open CLSID key", vbCritical
Exit Sub
End If
lxKey = 0
Do
lbufKeyName = BUF_LEN
bufKeyName = String(BUF_LEN, Chr$(0))
lbufClassName = BUF_LEN
bufClassName = String(BUF_LEN, Chr$(0))
lret = RegEnumKeyEx(hCLSIDKey, lxKey, bufKeyName, lbufKeyName, _
0, bufClassName, lbufClassName, ft)
lxKey = lxKey + 1
DoEvents
If lret = ERROR_SUCCESS Then
' We have a subkey of CLSID (a class key) -
' check its subkeys for OLE DB Provider key
lret2 = RegOpenKeyEx(HKEY_CLASSES_ROOT, "CLSID\" & _
Search WWH ::




Custom Search