About running SQLite.dll


Erarslan

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.