The problem may not be in your dll, but the application that contains the call to your dll. I have great success using the following to pass connected sessions to dlls.
Make sure dll is in path or directory app can find.
//Oracle session that connected
TOracleSession *OSession;
//Forward...
Instead of running a query use TOracleSession.CheckConnection in a timer event. If the session has lost its database connection your TOracleDataSet and TOracleQuery components will be closed. If the connection is lost reconnect and instantiate components.
Has anyone experienced the error ORA-00904-invlaid column name on the call to dataset->Open? This error message does not happen all the time. The same code can execute 1 to n number of times before getting the error.
My sql statement does have a user defined ORACLE function call embedded in...