Hi Clive,
You have to do a lot of this sort of thing to output string desctiptions of enum values:
'================================================= ====================
' OutputConstantDescriptions Function
' --------------------------
' Evaluates long constant values and outputs corresponding string
' description.
'
' Param Use
' ------------------------------------------------
' lngCursorLocation Value of constant in the
' ADODB.CursorLocationEnum.
' lngCursorType Value of constant in the
' ADODB.CursorTypeEnum.
' lngLockType Value of constant in the
' ADODB.LockTypeEnum.
'
' Returns
' -------
'
'================================================= ====================
Private Function OutputConstantDescriptions(ByVal lngCursorLocation As Long, _
ByVal lngCursorType As Long, _
ByVal lngLockType As Long)
Dim strRequestedCursorLocation As String
Dim strRequestedCursorType As String
Dim strRequestedLockType As String
Dim strOutputString As String
On Error GoTo Err_Handler
Select Case lngCursorLocation
Case adUseServer
strRequestedCursorLocation = "Server-side"
Case adUseClient
strRequestedCursorLocation = "Client-side"
End Select
Select Case lngCursorType
Case adOpenForwardOnly
strRequestedCursorType = "Forward-Only"
Case adOpenKeyset
strRequestedCursorType = "Keyset"
Case adOpenDynamic
strRequestedCursorType = "Dynamic"
Case adOpenStatic
strRequestedCursorType = "Static"
End Select
Select Case lngLockType
Case adLockReadOnly
strRequestedLockType = "Read-Only"
Case adLockPessimistic
strRequestedLockType = "Pessimistic"
Case adLockOptimistic
strRequestedLockType = "Optimistic"
Case adLockBatchOptimistic
strRequestedLockType = "BatchOptimistic"
End Select
strOutputString = vbTab & strRequestedCursorLocation & ", " & _
strRequestedCursorType & " cursor with " & _
strRequestedLockType & " locking."
Call WriteOutput(strOutputString)
Exit_Here:
On Error Resume Next
Exit Function
Err_Handler:
Err.Raise Err.Number, "clsADOCursorAnalyzer::OutputConstantDescriptions" , Err.Description
Resume Exit_Here
End Function
HTH,
Bob
|