2
votes

I'm trying to connect to SQLite through ODBC/Windows 7 with VbScript.

Using Werner's SQLite ODBC driver (http://www.ch-werner.de/sqliteodbc) to connect to a local SQLite file (c:\test.db).

enter image description here

Using the connection string suggest at https://www.connectionstrings.com/sqlite3-odbc-driver

Dim dbConn : Set dbConn = CreateObject("ADODB.Connection")
ConnectionString = "DRIVER=SQLite3 ODBC Driver;Database=c:\test.db;LongNames=0;Timeout=1000;NoTXN=0; SyncPragma=NORMAL;StepAPI=0;"
dbConn.open ConnectionString

I already tried reinstalling the driver and restarting the system. The error message is always there:

Error:  [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Code:   80004005
Source:     Microsoft OLE DB Provider for ODBC Drivers

Any ideas?

1

1 Answers

3
votes

Quoted from the SQLite ODBC Driver developer (Christian):

Check your installation. Version 0.992 is pretty old, current version is 0.999. If you have a 64 bit Windows, install both 64 and 32 bit drivers. It could be that the VB stuff is still 32 bit.

The program launching the script was 32Bit (despite the OS is 64Bit). Hence the need to install both 32 and 64Bit versions of the driver.