When I bring data from .db file to excel sheet , there is a problem with some records that return twice to the sheet and deleting the next record. The issue appears in record 256 and
adding 256 to it: 512,768 ..etc .
When I change the parameters of rst.Open strSQL, conn, 1, 1
to rst.Open strSQL, conn
It returns only the missing records.
Private Sub CommandButton1_Click()
query_Data "SELECT * FROM Test_Table;"
End Sub
Private Sub query_Data(strSQL As Variant)
Cells.ClearContents
Dim conn As Object
Dim rst As Object
Set conn = CreateObject("ADODB.Connection")
Set rst = CreateObject("ADODB.Recordset")
conn.Open "DRIVER=SQLite3 ODBC Driver;Database=E:\A disk\Lit\Data.db;"
rst.Open strSQL, conn, 1, 1
[Range("A1").CopyFromRecordset][1] rst
rst.Close
Set rst = Nothing: Set conn = Nothing
Range("a1").Select
End Sub