Subject: TQuery.Open/DBiQExec

        Hey folks,
 I use Delphi 2.O, MS SQL Server 6.5 and BDE/ODBC.

Can anyone help me with TQuery.Open / DBiQExec calls?

I have DataModule with TDatabase, TSession and two
TQuery-s (q1, q2) with respective TDataSource-s (ds1, ds2).
Bouth queries contains simple statements:
q1:select * from table1 (q2:select * from table2) and
are linked with database1 and session1.

... program code ...
:
: with DataModule1 do
: begin
:       database1.Open; // Makes new connection -- ok
:       q1.Open;        // Doesn't make new connection -- ok
:       q2.Open;        // MAKES NEW CONNECTION :^|  -- whyyyyy?
: end
:

TQuery.Open calls Check(DbiQExec(StmtHandle, PCursor));
The first call spawns such ODBC calls:
:
: SQLAllocStmt(hdbc001625F0, phstmt00155A98);
: SQLExecDirect(hstmt00155A98, "select * from table1", -3);
: SQLNumResultCols(hstmt00155A98, pccol);
: SQLDescribeCol(hstmt00155A98, 1, szColName, 32, pcbColName, pfSqlType,
pcbColDef, pibScale, pfNullable);
: ...
: SQLBindCol(hstmt00155A98, 1, 1, rgbValue, 13, pcbValue);
: ...
:

The second:
:
: >>> SQLAllocConnect(henv00161D78, phdbc001550C0); <<<
: >>> SQLDriverConnect(hdbc001550C0, hwnd00000000,
"DATABASE=MYDB;DSN=MSSQLServerDSN;UID=myuid????????t", -3, szConnStrOut,
255, pcbConnStrOut, 0); <<<
:
: SQLAllocStmt(hdbc001550C0, phstmt00155398);
: SQLExecDirect(hstmt00155398, "select * from table2", -3);
: SQLNumResultCols(hstmt00155398, pccol);
: SQLDescribeCol(hstmt00155398, 1, szColName, 32, pcbColName, pfSqlType,
pcbColDef, pibScale, pfNullable);
: ...
: SQLBindCol(hstmt00155398, 1, 1, rgbValue, 13, pcbValue);
: ...
:

SQLAllocConnect and SQLDriverConnect are unwanted.
How can I prevent the call of SQLAllocConnect and SQLDriverConnect?

Well, I know MS SQL ODBC driver support only one active statement per
connection, but as mk:@ivt:kb/Source/sqlserver/q140896.htm says,
ODBC driver uses server cursors, so to use of multiple active
sql statements is possible.

 In case, u have any suggestions, please send copy
mailto:ban...@bsc.anet.cz also, because my access to the
web is very unconvenient.

BTW: Is there any possibility to specify whether to use
or not to use the cursor library (ODBCCR32.DLL)?

                TIA
                   -Tibor