How do I retrieve data from SQLITE to VB6?

I use SQLite3 ODBC driver as my connection string,

Dim conn As ADODB.Connection
Set conn = New ADODB.Connection
Dim rs As New ADODB.Recordset

Set conn = New ADODB.Connection
conn.ConnectionString = "DRIVER=SQLite3 ODBC Driver;Database =test.db;LongNames=0;Timeout=1000;NoTXN=0;SyncPragma=NORMAL;StepAPI=0;"

conn.Open

rs.Open "select * from Artists", conn, adOpenDynamic, adLockOptimistic
MsgBox rs.Fields(0)

See here for connection string attributes:
http://www.connectionstrings.com/sqlite

You should also specify the version (3 or 2).

Edit: try to delete: LongNames = 0; Timeout = 1000; NoTXN = 0; SyncPragma = NORMAL; StepAPI = 0 and add version: version = 3 If it works, try adding one attribute at a time until it no longer works To identify the damaged attribute.

I use the SQLite3 ODBC driver as my connection string,

< pre>Dim conn As ADODB.Connection
Set conn = New ADODB.Connection
Dim rs As New ADODB.Recordset

Set conn = New ADODB.Conn ection
conn.ConnectionString = “DRIVER=SQLite3 ODBC Driver;Database=test.db;LongNames=0;Timeout=1000;NoTXN=0;SyncPragma=NORMAL;StepAPI=0;”

conn.Open

rs.Open “select * from Artists”, conn, adOpenDynamic, adLockOptimistic
MsgBox rs.Fields(0)

< /p>

See here for connection string attributes:
http://www.connectionstrings.com/sqlite

You should also specify the version (3 or 2) .

Edit: try to delete: LongNames = 0; Timeout = 1000; NoTXN = 0; SyncPragma = NORMAL; StepAPI = 0 and add version: version = 3 If it works, try adding one attribute at a time, Until it no longer works, to identify the damaged attribute.

Leave a Comment

Your email address will not be published.