Hi,
I installed both 32 and 64 bir SQLite ODBC driver from here. I used this code in VBA but "Out of Memory" error appear.
When I use 32 bit DSN then "wron architecture" message appear. My machine is 64 bit.
Dim conn As Object, rst As Object
Dim strSQL As String
Set conn = CreateObject("ADODB.Connection")
Set rst = CreateObject("ADODB.Recordset")
' OPEN CONNECTION
conn.Open "Dsn=SQLiteDatasource64;Database=c:\Kurdak.db;Version=3;"
strSQL = "SELECT * FROM test "
' OPEN RECORDSET
rst.Open strSQL, conn
' OUTPUT TO WORKSHEET
Debug.Print rst
rst.Close
' FREE RESOURCES
Set rst = Nothing: Set conn = Nothing
Where am I wrong?
I wish we have "table and search in table utilities" in VBA. 😞
Regards,
Mucip:)
Solved! Go to Solution.
Solved by mucip. Go to Solution.
Hi again,
I found solution to my own question and wants to share here.
I used X64 ODBC Driver
Dim conn As Object, rst As Object
Dim strSQL As String
Set conn = CreateObject("ADODB.Connection")
Set rst = CreateObject("ADODB.Recordset")
' OPEN CONNECTION
conn.Open "DRIVER=SQLite3 ODBC Driver;Database=c:\Kurdak.db;Version=3;"
strSQL = "SELECT * FROM tartim "
' OPEN RECORDSET
rst.Open strSQL, conn
' OUTPUT TO WORKSHEET
Do Until rst.EOF
Debug.Print rst.Fields(1)
Debug.Print "----"
rst.MoveNext
Loop
rst.Close
' FREE RESOURCES
Set rst = Nothing: Set conn = Nothing
Regards,
Mucip:)
Hi,
And also SQLite memory table connection string here:
conn.Open "DRIVER=SQLite3 ODBC Driver;Database=:memory:;Version=3;New=True;"
Regards,
Mucip:)