how do i retrieve data from SQLite to VB6?
i am开发者_如何学JAVA using 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)
Refer here for the connection string properties: http://www.connectionstrings.com/sqlite
You should also specify the 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 it works, try to add a property at a time until it won't work anymore, to identify the broken property.
These are available connect 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=
I just created a system DSN and looked in registry at HKLM\SOFTWARE\ODBC\ODBC.INI\<<my_dsn_here>>
精彩评论