I have an app in VB6. The app works with dbs SQL Server and SQLite. I installed ODBC drivers for SQLite. I made connections to dbs cn and cnsqlite. The app has to filter data from SQL Server, create a new empty db SQLite and insert data into db SQLite. I create a query and a command
sqlStr2 = "Select * INTO " & rsad.Fields("Table_Name") & " FROM (select * from [ODBC;Driver={SQL Server Native Client 10.0};Server=server2\SQLEXPRESS;Database=base1;uid=user;pwd=userpwd;].dbo." & rsad.Fields("Table_Name") & filter & ")"
cnsqlite.Execute sqlStr2, dbFailOnError
The app in the command arises the error only one SQL statement allowed
I deleted in the query (select * from). The same error arised. Before with db MS Access these statements normally worked. What to do? How rightly need to compose the query?
Temur Yakubov
I deleted in the query (select * from).
1条答案
按热度按时间szqfcxe21#
Instead of
select * into
you need to usecreate table tablename as
If above query is not working then you might try to create a temp table first then insert it into your desired table.
as select * from temp_table" cnsqlite.Execute sqlMainQuery, dbFailOnError