Option Explicit


Sub selectFromTab(db As Long, strSQL As String)
'used
Dim k As Variant
Dim stmt As Long
stmt = prepareStmt(db, strSQL)
sqlite3_bind_int stmt, 1, 0

Dim rowNo As Long, blob() As Byte, i As Long

While sqlite3_step(stmt) <> SQLITE_DONE

rowNo = rowNo + 1

Dim colNo As Long
colNo = 0
While colNo <= 2

If sqlite3_column_type(stmt, colNo) = SQLITE_INTEGER Then

cells(rowNo, colNo + 1) = sqlite3_column_int(stmt, colNo)
k = sqlite3_column_text(stmt, colNo)
k = 3
ElseIf sqlite3_column_type(stmt, colNo) = SQLITE_FLOAT Then

cells(rowNo, colNo + 1) = sqlite3_column_double(stmt, colNo)
k = sqlite3_column_text(stmt, colNo)
k = 3
ElseIf sqlite3_column_type(stmt, colNo) = SQLITE_TEXT Then

cells(rowNo, colNo + 1) = sqlite3_column_text(stmt, colNo)
k = sqlite3_column_text(stmt, colNo)
k = 3
ElseIf sqlite3_column_type(stmt, colNo) = SQLITE_NULL Then

cells(rowNo, colNo + 1) = "n/a"
ElseIf sqlite3_column_type(stmt, colNo) = SQLITE_BLOB Then
cells(rowNo, colNo + 1) = "Blob"
blob = sqlite3_column_blob(stmt, colNo)
Debug.Print arraysize(blob)
For i = 0 To arraysize(blob) - 1
Debug.Print blob(i), i

Next i
Else
cells(rowNo, colNo + 1) = "?"
End If
colNo = colNo + 1
Wend

Wend

sqlite3_finalize stmt

End Sub
Property Let cells(ByVal a As Long, ByVal b As Long, v)
OutX(a, b) = v
End Property