我的查询代码如下,客户端安装了Oracle 9客户端组件,并用netassist连通
请问我的数据连接都是及时关闭,为什么连接数还会超过现在设置的200呢?
//生成B类报文:返回查询结果
function TFormMain.doQryDataFromDB(sQry:string):string;
var
sReturn,sConnInfo:string;
i,j:integer;
curDataBase: TDataBase;
curQuery: TQuery;
AList:TStringList;
begin
if sQry= ' ' then
sReturn :=oCommPacket_Head+ErrPacket_Head+ '0 '+
oCommPacket_DataBEG+ '输入条件不正确,请重新输入! '+
oCommPacket_DataEnd+oCommPacket_Foot
else
begin
try
CoInitialize(nil);
//动态创建数据库连接及查询对象
AList:=TStringList.Create;
AList.LoadFromFile( 'DBConn.txt ');
curDataBase :=TDataBase.Create(Nil);
curDataBase.DriverName :=copy(AList.Strings[0],pos( '= ',AList.Strings[0])+1,length(AList.Strings[0]));
curDataBase.DataBaseName :=copy(AList.Strings[1],pos( '= ',AList.Strings[1])+1,length(AList.Strings[1]));
curDataBase.LoginPrompt :=False;
i :=0;
while i <AList.Count-2 do
begin
curDataBase.Params.Add(AList.Strings[i+2]);
i :=i+1;
end;
curQuery :=TQuery.Create(Nil);
curQuery.DatabaseName :=copy(AList.Strings[1],pos( '= ',AList.Strings[1])+1,length(AList.Strings[1]));
curDataBase.Open;
if (curDataBase.Connected)then
begin