Informix DLL's
Posted in 1994
Topics: Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL
Yo all, Has anyone tried this setup: 1/ An ESQL/C 5.01 for Windows application is linked into .EXE 2/ All database commits, rollbacks, connects etc... are in a DLL. The application calls the DLL to connect to the OnLine or SE server, the connection is OK in the DLL (the system returns SQLCODE=0), but the .EXE program doesn't recognise this database connection and returns with the message that it isn't connected to a database yet! I've used in the past a trick to achieve this with the older versions of Informix-ESQL/C 4.10 for DOS/Windows. The trick was to set the variable 'first_call' to 0 in the .EXE file, so that the .EXE program 'was aware' of that connection. This trick does no longer work for ESQL/C 5.01 for Windows. I've looked into the libraries of ESQL/C 5.01 and found out that it was now renamed to 'FirstCall' instead of 'first_call'. I've tried it with 'FirstCall=0' in my static linked Windows program, but it failed. The new added functions 'SetConnect', 'GetConnect' and 'ReleaseConnect' are not very well documented (no examples!!!). This will allow you to connect to the same database from multiple applications or .DLL's. But currently I had no luck to achieve this. Does anyone tried this, or is there another trick ??? Remember the database connection/disconnection happens in the DLL's and NOT in the .EXE. The .EXE doesn't contain any EXEC SQL DATABASE statement, instead it calls the .DLL function for it. Any suggestions are welcome... Cheers, Rony