Subject | Object in use |
---|---|
Author | Riho-Rene Ellermaa |
Post date | 2004-09-29T06:44:13Z |
I'm having trouble with "object in use" problem
I use the following code:
Query->SQL->Clear();
Query->SQL->Add("select
* from for_corresp for update");//notr
Query->Open();
while(!Query->Eof)
{ String
S1=Query->FieldByName("baddress")->AsString;
if(S1.Length()>70)
{
S1.SetLength(70);
Query->Edit();
Query->FieldByName("baddress")->AsString=S1;
Query->Post();
}
Query->Next();
}
Trans->Commit();
Query->Close();
Trans->StartTransaction();
Query->SQL->Clear();
//this block is just to get rid rid of object in use message
Query->SQL->Add("select
* from for_pay for update");//notr
Query->Open();
Query->Close();
Trans->Commit();
MyScript->Execute();
//In this script I want to drop FOR_CORRESP table
How can I stop the FOR_CORRESP to being in use?
For a moment I solved the problem by closing and opening database
connection.
Riho Ellermaa
I use the following code:
Query->SQL->Clear();
Query->SQL->Add("select
* from for_corresp for update");//notr
Query->Open();
while(!Query->Eof)
{ String
S1=Query->FieldByName("baddress")->AsString;
if(S1.Length()>70)
{
S1.SetLength(70);
Query->Edit();
Query->FieldByName("baddress")->AsString=S1;
Query->Post();
}
Query->Next();
}
Trans->Commit();
Query->Close();
Trans->StartTransaction();
Query->SQL->Clear();
//this block is just to get rid rid of object in use message
Query->SQL->Add("select
* from for_pay for update");//notr
Query->Open();
Query->Close();
Trans->Commit();
MyScript->Execute();
//In this script I want to drop FOR_CORRESP table
How can I stop the FOR_CORRESP to being in use?
For a moment I solved the problem by closing and opening database
connection.
Riho Ellermaa