How to get data from SQLite in VB6?

I am using the SQLite3 ODBC driver as the 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)
+5
source share
2 answers

Contact here for connection string properties: http://www.connectionstrings.com/sqlite

You must also specify a version (3 or 2).

Edit: try to remove: LongNames = 0; Timeout = 1000; NoTXN = 0; SyncPragma = NORMAL; StepAPI = 0 And add the version: version = 3 If this works, try adding the property at a time until it no longer works to identify the broken property.

+3
source

These are the available connection string options for SQLite3 ODBC Driver

Description=
Database=<<file_name>
Timeout=
StepAPI=0
SyncPragma=
NoTXN=0
ShortNames=0
LongNames=0
NoCreat=0
NoWCHAR=0
FKSupport=0
LoadExt=

DSN HKLM\SOFTWARE\ODBC\ODBC.INI\<<my_dsn_here>>

+2

All Articles