このアノテーションでは、メソッドのアクセス修飾子やメンバー変数にテストメソッドでアクセスする場合に、それらを public に変更する必要はありません。たとえば、外部クラスに対して非公開メンバー変数を表示せずに、テストメソッドからアクセスできるようにする場合は、TestVisible アノテーションを変数定義に追加します。
Public Sub TestSelectCustomize()
#If Win64 Then
Dim myDbHandle As LongPtr
Dim myStmtHandle As LongPtr
#Else
Dim myDbHandle As Long
Dim myStmtHandle As Long
#End If
Dim RetVal As Long
Dim stepMsg As String
Debug.Print "----- TestSelect Start -----"
' Open the database - getting a DbHandle back
RetVal = SQLite3Open(TestFile, myDbHandle)
Debug.Print "SQLite3Open returned " & RetVal
'-------------------------
' Select statement
' ===============
' Create the sql statement - getting a StmtHandle back
RetVal = SQLite3PrepareV2(myDbHandle, "SELECT * FROM " & TableName, myStmtHandle)
Debug.Print "SQLite3PrepareV2 returned " & RetVal
' Start running the statement
RetVal = SQLite3Step(myStmtHandle)
If RetVal = SQLITE_ROW Then
Debug.Print "SQLite3Step Row Ready"
PrintColumns myStmtHandle
Else
Debug.Print "SQLite3Step returned " & RetVal
End If
Dim colCount As Long
Dim colName As String
Dim colType As Long
Dim colTypeName As String
Dim colValue As Variant
Dim i As Long
colCount = SQLite3ColumnCount(myStmtHandle)
Debug.Print "Column count: " & colCount
For i = 0 To colCount - 1
colName = SQLite3ColumnName(myStmtHandle, i)
colType = SQLite3ColumnType(myStmtHandle, i)
colTypeName = TypeName(colType)
colValue = ColumnValue(myStmtHandle, i, colType)
Debug.Print "Column " & i & ":", colName, colTypeName, colValue
Next
' Close the database
RetVal = SQLite3Close(myDbHandle)
Debug.Print "----- TestSelect End -----"
End Sub