Article View: borland.public.cppbuilder.database.dbexpress
Article #116sqlquery in a thread
From: Fabi�n
Date: Mon, 01 Nov 2004 14:58
Date: Mon, 01 Nov 2004 14:58
47 lines
2500 bytes
2500 bytes
Hi.
I'm trying to open a TSQLQuery in a thread called by a TServiceApplication.
The Query is declared in the TServiceApplication and passed as a pointer to
the tread (declared in the header file).
I can sucsesfully execute a store procedure in the query (the store doesn't
return any row). But if I use a sotre that returns a row the thread crashes.
The strange thing is that it doesn't execute the code in the catch, it
simply stops.
Here is some part of the code:
try
{
ARequestInfo->Session->Content->Values["WAITING_SP"] = 1;
//quitar planes
SP_QUITAR_PLAN_VENTAS->SQL->Text = "EXECUTE PROCEDURE
VT_WAP_QUITAR_PLAN_VENTAS(" +
(AnsiString)ARequestInfo->Session->Content->Values["ORDERREQUEST_ID"] + ","
+
ARequestInfo->Session->Content->Values["APPLICATIONS_ID"] + ")";
SP_QUITAR_PLAN_VENTAS->ExecSQL();
//aplicar planes
appliedPlans->Clear();
appliedPlans_tosave->Clear();
ARequestInfo->Session->Content->Values["WAITING_SP"] = 2;
dsPlanOrders->SQL->Text = "SELECT * FROM VT_GET_ORDERS(" +
ARequestInfo->Session->Content->Values["APPLICATIONS_ID"] + "," +
ARequestInfo->Session->Content->Values["ORDERREQUEST_ID"] + ")";
dsPlanOrders->Active = Open();
ARequestInfo->Session->Content->Values["WAITING_SP"] = 3;
while(!dsPlanOrders->Eof)
{
the code continues...
I use this: ARequestInfo->Session->Content->Values["WAITING_SP"] to have
a simple log of the thread. I'm shure that the code stops when it tryes to
open the query.
Can someone help me with this strange problem?
Technical Details
Message-ID:
<41864e04@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: fb4e2,b9acf6dc8b7843da,start X-Google-Attributes: gidfb4e2,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Fabi�n" <fabianfierro@hotmail.com> From: "Fabi�n" <fabianfierro@hotmail.com> Newsgroups: borland.public.cppbuilder.database.dbexpress Subject: sqlquery in a thread Date: Mon, 1 Nov 2004 11:58:02 -0300 Lines: 49 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 NNTP-Posting-Host: 200.68.64.9 Message-ID: <41864e04@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1099320836 200.68.64.9 (1 Nov 2004 06:53:56 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail