Erarslan Posted May 16, 2023 Share Posted May 16, 2023 I would like to make using SQLite database to my project. for this, I used "SQLite.dll". Many function defined in SQLite.dll is running. But when I call "SELECT" command is not reply. Maybe I'm making some wrong. I'm adding SQLite.dll and code for this topic. Could you please give us your suggestion? My DAQ factory code; global dbOpen global dbCommand global dbError global dbClose global string dbase = "DataLogger.db" global dbe global string sql global callback global string error global data //sql = "CREATE TABLE logTable(ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL UNIQUE, ChannelName CHAR(25) NOT NULL, Value INTEGER NOT NULL)" (This OK) //sql = "INSERT INTO logTable (ID,ChannelName,Value) VALUES(1,'Channel1',25)" (This Ok) sql = "SELECT * FROM dataLog" (This no reply) extern("C:\DAQFactory\sqlite3.dll","long sqlite3_open(string,long[1])","SQLiteOpen","stdcall") dbOpen = SQLiteOpen(dbase,@dbe) extern("C:\DAQFactory\sqlite3.dll","long sqlite3_exec(long,string,long,string,string[20])","SQLiteCmd","stdcall") dbCommand = SQLiteCmd(dbe,sql,callback,NULL,@error) extern("C:\DAQFactory\sqlite3.dll","long sqlite3_errmsg()","SQLiteErr","stdcall") dbError = SQLiteErr(dbe) extern("C:\DAQFactory\sqlite3.dll","long sqlite3_close(long)","SQLiteClose","stdcall") dbClose = SQLiteClose(dbe) --------------------------------------------------- C project code related to the topic https://stackoverflow.com/questions/31146713/sqlite3-exec-callback-function-clarification I think I can't run the Calback function like in this example Thanks in advance for your help, SQLite3.dll Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted May 16, 2023 Share Posted May 16, 2023 DAQFactory does not support callbacks through the extern() function. The only way to do it is to create a wrapper DLL that handles the callback, then create some normal functions that retrieve the data from the callback. It would be much easier to simply use ODBC and DAQFactory's database capabilities. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.