[INCLUDE]
MySQL_Select
MySQL_Select_GetValue

[CODE]
Public Sub MySQL_Select_GetVarValue(ByVal hQRManual As Long, ByVal IndexID As Long, ByRef xVar As Variant, Optional ByVal xRaiseError As Boolean = True)
  Dim xChar1 As String
  Dim xDate1 As Date
  Dim xLong1 As Long
  Dim xLong2 As Long
  Dim xLong3 As Long

  xChar1 = MySQL_Select_GetValue(hQRManual, IndexID)
  Select Case VarType(xVar)
    Case VbVarType.vbDate
      If Len(xChar1) = 19& Then
        xDate1 = TimeSerial(Val(Mid(xChar1, 12, 2&)), Val(Mid(xChar1, 15, 2&)), Val(Mid(xChar1, 18, 2&)))
        GoTo AddDate
        ElseIf Len(xChar1) = 10& Then
AddDate:
        xLong1 = Val(Left(xChar1, 4&))
        xLong2 = Val(Mid(xChar1, 6, 2&))
        xLong3 = Val(Mid(xChar1, 9, 2&))
        If xLong1 = 0& Or xLong2 = 0& Or xLong3 = 0& Then
          xVar = xDate1
          Else
          xVar = xDate1 + DateSerial(xLong1, xLong2, xLong3)
          End If
        ElseIf Len(xChar1) > 0& Then
        Error 13
        End If
    Case VbVarType.vbBoolean
      xVar = CBool(-CLng(Val(xChar1)))
    Case VbVarType.vbString
      xVar = xChar1
    Case VbVarType.vbError, _
         VbVarType.vbArray, _
         VbVarType.vbDataObject, _
         VbVarType.vbObject, _
         VbVarType.vbUserDefinedType
      If xRaiseError Then Error 13
    Case Else
      xVar = Val(xChar1)
      If Not Trim(Str(xVar)) = Trim(xChar1) Then
        If xRaiseError Then Error 13
        End If
    End Select
  End Sub