I've tryed to connect to a SQlite database (with this extension: .sqlite) using: AG_SQLite.dll.
But when I connect to the database and try to get all data it gives me an error:
Module /declarations:Code:Option Explicit Private strFilename As String Private Sub Command1_Click() strFilename = "C:\data.sqlite" ok End Sub Public Sub ok() Dim DB_Handle As Long Dim strErrMsg As String Dim TableArray() As Variant Dim strQuery As String Dim intCounter1 As Integer Dim intRecords As Integer strQuery = "Select * From ASDTable" DB_Handle = ModSqlite.sqlite_open(strFilename, 0, strErrMsg) TableArray = ModSqlite.ags_sqlite_get_table(DB_Handle, strQuery, strErrMsg) intRecords = ModSqlite.ags_number_of_rows_from_last_call If intRecords > 0 Then For intCounter1 = 1 To UBound(TableArray) Text1.Text = Text1.Text & TableArray(intCounter1) Next intCounter1 sqlite_close DB_Handle Else MsgBox "error" End If End Sub
Code:Option Explicit Public Declare Function sqlite_open Lib "AGS_SQLite.dll" (ByVal filename As String, ByVal mode As Long, ByRef errstr As String) As Long Public Declare Sub sqlite_close Lib "AGS_SQLite.dll" (ByVal DB_Handle As Long) Public Declare Function sqlite_last_insert_rowid Lib "AGS_SQLite.dll" (ByVal DB_Handle As Long) As Long Public Declare Function sqlite_changes Lib "AGS_SQLite.dll" (ByVal DB_Handle As Long) As Long Public Declare Function sqlite_libversion Lib "AGS_SQLite.dll" () As String Public Declare Function sqlite_libencoding Lib "AGS_SQLite.dll" () As String Public Declare Function ags_sqlite_get_table Lib "AGS_SQLite.dll" (ByVal DB_Handle As Long, ByVal SQLString As String, ByRef errstr As String) As Variant() Public Declare Function ags_sqlite_libversion Lib "AGS_SQLite.dll" () As String Public Declare Function ags_number_of_rows_from_last_call Lib "AGS_SQLite.dll" () As Long
I've tryed with other DLLs and methods but no success
Can someone give me a working example of reading data from a .sqlite file?!





Reply With Quote