Thread View: borland.public.cppbuilder.database.multi-tier
1 messages
1 total messages
Started by Antonio Eligio Perez Moron
Fri, 14 May 2004 07:28
too many open tables error
Author: Antonio Eligio Perez Moron
Date: Fri, 14 May 2004 07:28
Date: Fri, 14 May 2004 07:28
73 lines
2622 bytes
2622 bytes
my code :
TForm1::LeeHistoricos(TDateTime fecha_hora_inicial,TDateTime
fecha_hora_final,unsigned short entrada,unsigned char tipo_entrada)
{
TQuery * TablaDatos = new TQuery(NULL) ;
String consulta;
String select;
try
{
try
{
// TablaDatos->Close();
consulta = " fechahora >= '" +
fecha_hora_inicial.FormatString("mm/dd/yyyy hh:nn") + "' and fechahora <= '"
+ fecha_hora_final.FormatString("mm/dd/yyyy hh:nn") + "' and NUMEROENTRADA =
" + IntToStr(entrada) ; // + " order by fechahora " ;
TablaDatos->SQL->Clear();
select = "select * from 'F:\\ely\\PROYECTOS ELY\\PROYECTO
REMOTA\\ERU\\BASEDATOS\\DTA.db' where " + consulta ;
TablaDatos->SQL->Add(select);
TablaDatos->ExecSQL();
TablaDatos->Open();
if (!TablaDatos->Eof) TablaDatos->First();
while (!TablaDatos->Eof)
{
TablaDatos->Next();
}
// TablaDatos->Close();
}
catch(Exception &e)
{
int i = 0 ;
//TablaDatos->Close;
// delete TablaDatos;
// TQuery * TablaDatos = new TQuery(NULL) ;
}
}
__finally
{
TablaDatos->Close();
Sleep(500);
delete TablaDatos;
}
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
for (int i = 0;i<500;i++)
{
LeeHistoricos((TDateTime) "13/05/2004 08:00",(TDateTime) "13/05/2004
09:00",2,2);
Edit1->Text = i;
Application->ProcessMessages();
}
ShowMessage("end") ;
}
when i = 251 go to the catch code and the error is too many open tables.
thank you
Too many open tables error
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads