' 单击 [事件] ControlIndex=控件数组的索引 hWndForm=窗体句柄 hWndControl=控件句柄 ionControl=按钮的标识符
Sub Form1_Command1_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd) '单击
If SQLite31.Open(App.Path & "sqlite3_test.db", "") = False Then
Print "打开数据库成功"
Else
Print "打开数据库失败 " & SQLite31.ErrMsg
End If
End Sub
' 单击 [事件] ControlIndex=控件数组的索引 hWndForm=窗体句柄 hWndControl=控件句柄 ionControl=按钮的标识符
Sub Form1_Command2_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd) '单击
If SQLite31.SetKey("123456") = False Then Print SQLite31.ErrMsg
Print "修改密码"
End Sub
' 单击 [事件] ControlIndex=控件数组的索引 hWndForm=窗体句柄 hWndControl=控件句柄 ionControl=按钮的标识符
Sub Form1_Command3_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd) '单击
Dim rs() As String
Dim u As Long = SQLite31.SqlFind("SELECT * FROM features WHERE id=100", rs())
Dim As Long x,y
If u = 0 Then Print SQLite31.ErrMsg
Print UBound(rs), UBound(rs, 2)
For y = 0 To UBound( rs)
For x = 0 To UBound(rs, 2)
Print rs(y, x) ,
Next
Print
Next
End Sub
' 单击 [事件] ControlIndex=控件数组的索引 hWndForm=窗体句柄 hWndControl=控件句柄 ionControl=按钮的标识符
Sub Form1_Command4_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd) '单击
Dim rs() As String
Dim u As Long = SQLite31.Find("features", "id>0", rs())
Dim As Long x,y
If u = 0 Then Print SQLite31.ErrMsg
Print UBound(rs), UBound(rs, 2)
For y = 0 To UBound( rs)
For x = 0 To UBound(rs, 2)
Print Utf8toStr(rs(y, x)),
Next
Print
Next
End Sub
' 单击 [事件] ControlIndex=控件数组的索引 hWndForm=窗体句柄 hWndControl=控件句柄 ionControl=按钮的标识符
Sub Form1_Command5_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd) '单击
Dim rs() As String
Dim u As Long = SQLite31.FindOne("features", "id=2", rs())
Dim As Long x,y
If u = 0 Then Print SQLite31.ErrMsg
Print "字段数:" & UBound(rs) + 1
For x = 0 To UBound(rs)
Print Utf8toStr(rs(x))
Next
Print
End Sub
' 单击 [事件] ControlIndex=控件数组的索引 hWndForm=窗体句柄 hWndControl=控件句柄 ionControl=按钮的标识符
Sub Form1_Command6_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd) '单击
If SQLite31.SetKey("") = False Then Print SQLite31.ErrMsg
Print "清除密码"
End Sub
' 单击 [事件] ControlIndex=控件数组的索引 hWndForm=窗体句柄 hWndControl=控件句柄 ionControl=按钮的标识符
Sub Form1_Command7_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd) '单击
Print SQLite31.AddItem ("features", "title=100,description='dd''d'")
End Sub
' 单击 [事件] ControlIndex=控件数组的索引 hWndForm=窗体句柄 hWndControl=控件句柄 ionControl=按钮的标识符
Sub Form1_Command8_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd) '单击
Print SQLite31.Update ("features","id=2", "description='更新内容'")
Print SQLite31.ErrMsg
End Sub
' 单击 [事件] ControlIndex=控件数组的索引 hWndForm=窗体句柄 hWndControl=控件句柄 ionControl=按钮的标识符
Sub Form1_Command9_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd) '单击
Print "数据库引擎版本:" & SQLite31.Version
End Sub
' 单击 [事件] ControlIndex=控件数组的索引 hWndForm=窗体句柄 hWndControl=控件句柄 ionControl=按钮的标识符
Sub Form1_Command10_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd) '单击
Dim rs() As String
Dim u As Long = SQLite31.SqlFind("PRAGMA table_info('features') ", rs()) ' features 为表名称
Dim As Long x,y
If u = 0 Then Print SQLite31.ErrMsg
Print UBound(rs), UBound(rs, 2)
For y = 0 To UBound( rs)
For x = 0 To UBound(rs, 2)
Print Utf8toStr(rs(y, x)),
Next
Print
Next
End Sub
' 单击 [事件] ControlIndex=控件数组的索引 hWndForm=窗体句柄 hWndControl=控件句柄 ionControl=按钮的标识符
Sub Form1_Command11_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd) '单击
Dim rs() As String
Print SQLite31.INIsetKey("软件配置", "测试项目", "测试值")
End Sub
' 单击 [事件] ControlIndex=控件数组的索引 hWndForm=窗体句柄 hWndControl=控件句柄 ionControl=按钮的标识符
Sub Form1_Command12_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd) '单击
Dim rs() As String
Print SQLite31.INIgetKey("软件配置", "测试项目", "默认值")
End Sub
' 单击 [事件] ControlIndex=控件数组的索引 hWndForm=窗体句柄 hWndControl=控件句柄 ionControl=按钮的标识符
Sub Form1_Command13_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd) '单击
Dim rs() As String
Dim id As Long = SQLite31.MaxID("features", "id")
If id = 0 Then
Print SQLite31.ErrMsg
Else
Print "删除ID=" & id
Print SQLite31.DeleteItem("features", "id=" & id)
End If
End Sub
' 单击 [事件] ControlIndex=控件数组的索引 hWndForm=窗体句柄 hWndControl=控件句柄 ionControl=按钮的标识符
Sub Form1_Command14_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd) '单击
Print SQLite31.Count("features")
End Sub
' 单击 [事件] ControlIndex=控件数组的索引 hWndForm=窗体句柄 hWndControl=控件句柄 ionControl=按钮的标识符
Sub Form1_Command15_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd) '单击
Dim id As Long = SQLite31.AddItem("[二进制]", "aaa=100") '为了避免表名称或字段名称与SQL内部名称冲突,可以用[] 括在中间,中文更应该括起来
If id = 0 Then
Print "出错:" & SQLite31.ErrMsg
Else
Dim by(10) As UByte
For i As Long = 0 To 10
by(i) = Int(Rnd * 255)
Print Hex(by(i), 2) & " " ;
Next
Print
Print SQLite31.UpdateByte("[二进制]", "ID=" & id, "[数据]", @by(0), 11) '为了避免表名称或字段名称与SQL内部名称冲突,可以用[] 括在中间,中文更应该括起来
Print "出错:" & SQLite31.ErrMsg
End If
End Sub
' 单击 [事件] ControlIndex=控件数组的索引 hWndForm=窗体句柄 hWndControl=控件句柄 ionControl=按钮的标识符
Sub Form1_Command16_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd) '单击
Dim rs() As String
Dim u As Long = SQLite31.Find("[二进制]", "", rs()) '为了避免表名称或字段名称与SQL内部名称冲突,可以用[] 括在中间,中文更应该括起来
Dim As Long x,y ,i
If u = 0 Then Print SQLite31.ErrMsg
Print UBound(rs), UBound(rs, 2)
For y = 0 To UBound( rs)
|