Re: ESQL/C
Posted in 1997
Alexey Poukhovsky wrote: > > Hello, All > > HELP!!!!! > Can anyone tell me, what to do with this situation: > I have to place some functions, which are working with Informix in DLL. > And make calls to them from different applications. For example, I create > DLL with only function: > long opendb(char *name) > { > $database name; > return sqlca.sqlcode; > } > The first application, called it got error=0 - it is Ok. > But, if the second app calls the same function (the first have not > finished), it has got error = -457. > After that both of applications become unusable - any of informix function > call got error -457. I do not think that you can put ESQL/C calls into a DLL. You will either have to link the functions directly into your executables or create a separate server task to handle database accesses and communicate with it using some other Win32 (I assume you are using WinNT or Win95 since you mention DLLs) IPC mechanism. I do this for some of my UNIX applications to isolate database accesses from the applications. On UNIX we would choose between shared memory, pipes, named-pipes, UNIX or network domain sockets or STREAMS (depending on UNIX variant) for IPC. Considering how "well" Win32 OS's multi-task and communicate you may be best off biting the memory bullet and link in the Informix interface functions (like your opendb()) directly into each application. Art S. Kagel