🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #911

TADOQuery creates own connection

#911
From: TBA
Date: Tue, 01 Mar 2005 12:57
55 lines
2381 bytes
Hi, I've a general ADO question:

I use a TADOConnection to connect to a SQLServer 7.0 DB. Then a
TADOQuery should use this connection to run a query, and then close the
connection. But if I use max() in my query the query opens it own
connection:




"select ID from TapeLib"                         <- without max()

SQL Profiler shows:
    Audit Login
        SQL:BatchCompleted    (SET NO_BROWSETABLE ON)
        SQL:BatchCompleted    (select ID from TapeLib)
    Audit Logout





"select max(ID) from TapeLib"                     <- with max()

SQL Profiler shows:
    Audit Login
        SQL:BatchCompleted    (SET NO_BROWSETABLE ON)
        SQL:BatchCompleted    (select ID from TapeLib)

        Audit Login
            SQL:BatchCompleted    (SET NO_BROWSETABLE ON)
            RPC:Completed         (declare @P1 int set@P1=1 exec...)
            SQL:BatchCompleted    (SET NO_BROWSETABLE OFF)
            RPC:Completed         (exec sp_unprepare 1)
        Audit Logout

    Audit Logout



Some Settings:

Connection->KeepConnection = true;
Connection->ConnectionString = "Provider=MSDASQL.1;OLE DB Services =
-2" + Logindata;
Connection->Provider = "MSDASQL.1";
Connection->CursorLocation = clUseServer;

Query->Connection = Connection;


The Query itself has no Connectionstring. Why there are 2 connections
shown in MS Profiler?

Thanks BM
Technical Details
Message-ID: <1109681871.633401.58950@l41g2000cwc.googlegroups.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!l41g2000cwc.googlegroups.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,6a833ae4fc8229ec,start
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!l41g2000cwc.googlegroups.com!not-for-mail
From: "TBA" <TheBigAnonymous@uboot.com>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: TADOQuery creates own connection
Date: 1 Mar 2005 04:57:51 -0800
Organization: http://groups.google.com
Lines: 56
Message-ID: <1109681871.633401.58950@l41g2000cwc.googlegroups.com>
NNTP-Posting-Host: 193.23.226.2
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1109681876 9572 127.0.0.1 (1 Mar 2005 12:57:56 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 1 Mar 2005 12:57:56 +0000 (UTC)
User-Agent: G2/0.2
Complaints-To: groups-abuse@google.com
Injection-Info: l41g2000cwc.googlegroups.com; posting-host=193.23.226.2;
   posting-account=qwH-kQ0AAABt8OHmTwRekTeO9uJTMnM0