softace / sqliteodbc

SQLite ODBC driver
http://www.sqliteodbc.org
Other
115 stars 36 forks source link

Cannot query sqlite_master or sqlite_temp_master tables #3

Open bucweat opened 5 years ago

bucweat commented 5 years ago

Per the sqlite3 faq one can simulate the .tables command with a query. I've tried this using the following query in Access with this syntax

SELECT * FROM [ODBC;DSN=SQLite3 Datasource;Database=C:\temp\test.db3].[sqlite_master]

which does not work. Querying a normal table (e.g. replace sqlite_master tablename with one given in .tables) works fine, so I know the syntax with the connection string embedded is correct/working.

So is the SQLite3ODBC driver limited from performing queries on "special" tables?

(BTW, "special" table is what sqlite_master is called on the faq page)

bucweat commented 5 years ago

Some additional info: running from a vbscript using ADODB connection object works:

Set objConn = CreateObject("ADODB.Connection") objConn.Open "DRIVER=SQLite3 ODBC Driver;Database=" & dbSqlite3 & ";" dim oRs: set oRs = objConn.execute("select name from sqlite_master where type = 'table'")

oRs will contain recordset with name field containing tables in the database.