'这里演示全代码操作,建议用控件
'--------------------------------------------------------------------------------
Sub Form1_Command2_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd) '单击
Dim As Long i, x, y
Print StrToWStr("") '如果你代码中没用到此函数,就需要引用下函数,不然会报错
Print wStrToUtf8("", 0) '如果你代码中没用到此函数,需要引用下函数,不然会报错
Dim db As SQLite3 Ptr 'DB 为后面使用数据用
If SQLiteOpen(db, App.Path & "test.db") Then
Print "失败" 'SQLiteErrMsg(hDB)
Exit Sub
End If
Dim sql As String, rs() As String
Sql = "select * from features where id>0 LIMIT 20"
Print SQLiteSelect(db, sql, rs())
Print "---------- 列名显示 --------------"
For x = 0 To UBound(rs, 2)
Print rs(0, x) & " , " ;
Next
Print
Print "---------- 内容显示 --------------------"
For y = 1 To UBound(rs, 1)
For x = 0 To UBound(rs, 2)
Print rs(y, x) & " , " ;
Next
Print
Next
SQLiteClose db
End Sub
|