Using Informix's C++ API and ESQL/C
Posted in 1999
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Versions, Editions & End-of-Life
Hello, Is it possible to establish a database connection using the Informix C++ API and then call a C function written in ESQL/C and have the C function use the already openned Database connection?. Let me provide an example: Inside the C++ code I establish a connection to the database using the ITConnection class then I do some operations, create a temporary table and insert data into the temporary table. Then I call a C function that Selects the data from the temporary table. Inside the C function, When I execute the Prepare statement, I receive error -1811. "Implicit connection not allowed after an explicit connection". Environment: AIX 4.3, IDS 7.31, SDK 2.3, ESQL 9.21 Any ideas? TIA Tino
Try NOT to do what the error message is telling you NOT to do. :) I have never tried it the way you described, but you may want to open an explicit connection from the ESQL/C finction too. Explicit like in using: $CONNECT TO dbname USER username USING password If you just want to use the connection already open, then you need do make sure that you do NOT have a CONNECT or DATABASE statement in the ESQL/C function. Hope that helps... Sandeep In article <7rbaqo$rbr$1@news.xmission.com>, "Tino Cremidis" <ccremid@saa.noaa.gov> wrote: > > Hello, > > Is it possible to establish a database connection > using the Informix C++ API and then call a > C function written in ESQL/C and have the > C function use the already openned Database connection?. > > Let me provide an example: > Inside the C++ code I establish a connection > to the database using the ITConnection class > then I do some operations, create a temporary > table and insert data into the temporary table. > Then I call a C function that Selects the data > from the temporary table. > > Inside the C function, When I execute the Prepare statement, > I receive error -1811. > "Implicit connection not allowed after an explicit connection". > > Environment: > AIX 4.3, IDS 7.31, SDK 2.3, ESQL 9.21 > > Any ideas? > > TIA > > Tino > > Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.