Club Builder - Foros de discusión Club Builder
Foro de C++Builder en español
 
 FAQFAQ   BuscarBuscar   MiembrosMiembros   Grupos de UsuariosGrupos de Usuarios   RegistrarseRegistrarse 
 PerfilPerfil   Entra para ver tus mensajes privadosEntra para ver tus mensajes privados   EntrarEntrar 

POR FAVOR NECESITO AYUDA (Too Many Open TAbles ) ERROR

 
Publicar nuevo tema   Responder al tema    Foros de discusión -> Bases de Datos
Ver tema anterior :: Ver tema siguiente  
Autor Mensaje
Mensaje    Asunto: POR FAVOR NECESITO AYUDA (Too Many Open TAbles ) ERROR Responder citando

mi codigo es el siguiente ::


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("ZA CABO") ;
}



cuando i = 251 me da un error de too many open files

el builder es el 5 y la base datos paradox

por que

Gracias
Volver arriba
Mensaje    Asunto: Re: POR FAVOR NECESITO AYUDA (Too Many Open TAbles ) ERROR Responder citando

Utiliza tu rutina de esta forma:
Código:

TForm1::LeeHistoricos(TDateTime fecha_hora_inicial,TDateTime fecha_hora_final,unsigned short entrada,unsigned char tipo_entrada)
{
  TQuery *TablaDatos = NULL;
  String consulta = "";;
  String select = "";

  try{
    TablaDatos = new TQuery(NULL);
    TablaDatos->SQL->Clear();

    consulta   = " fechahora >= '" + fecha_hora_inicial.FormatString("mm/dd/yyyy hh:nn");
    consulta  += "' and fechahora <= '" + fecha_hora_final.FormatString("mm/dd/yyyy hh:nn");
    consulta  += "' and NUMEROENTRADA = " + IntToStr(entrada);

    select  = "select * from 'F:\\ely\\PROYECTOS ELY\\PROYECTO REMOTA\\ERU\\BASEDATOS\\DTA.db' where "
    select += consulta ;

    TablaDatos->SQL->Add(select);
    //TablaDatos->ExecSQL(); //El ExceSQL se utiliza cuando relaizas instrucciones insert, delete or update
    TablaDatos->Open(); //El Open se utiliza cuando realizas consultas Select
    TablaDatos->First();

    while(!TablaDatos->Eof){
      TablaDatos->Next();
    }

    TablaDatos->Close();
    delete TablaDatos;
    TablaDatos = NULL;
  }
  catch(Exception &err){
    if (TablaDatos != NULL){
      if (TablaDatos->Active) TablaDatos->Close();
      delete TablaDatos;
      TablaDatos = NULL;
    }

    throw Exception(err.Message);
  }
}



Si te sirve:

Código:

========
2. General BDE Limitations
========

48          Clients in system
32          Sessions per client
                (3.5 and earlier, 16 Bit, 32 Bit)
256         Sessions per client
                (4.0 & later, 32 Bit)
64          Sessions with a cursor open per client
                (4.0 & later, 32 Bit)
32          Open databases per session
                (3.5 and earlier, 16 Bit, 32 Bit)
2048        Open databases per session
                (4.0 & later, 32 Bit)
32          Loaded drivers
64          Sessions in system
                (3.5 and earlier, 16 Bit, 32 Bit)
12288       Sessions in system
                (4.0 & later, 32 Bit)
4000        Cursors per session
16          Entries in error stack
8           Table types per driver
16          Field types per driver
8           Index types per driver
48K         Size of configuration (IDAPI.CFG) file
64K         Max size of SQL statement (RequestLive=False)
4K          Max size of SQL statement (RequestLive=True)
6K          Max size of SQL statement (RequestLive=True)
                (BDE 4.01&later)
16K         Record buffer size (SQL and ODBC)

31          Table and field name size in characters
64          Stored procedure name size in characters
16          Fields in key
3           File extension size in characters
260         Table name length in characters
                (some servers might have other limits)
260         Path and file name length in characters
260         Index name length (including pseudo-indexes)
204         Setting for MEMSIZE in BDE Administrator
127         Tables with cached updates applied
                (BDE 4.0 & earlier, 32 Bit)
254         Tables with cached updates applied
                (BDE 4.01 & later, 32 Bit)
380         Maximum number of fields in Table for
                DbiCreateTable with Interbase
254         Maximum number of fields in Table for
                DbiCreateTable with Oracle
500         Maximum number of fields in Table for
                DbiCreateTable with Informix
252         Maximum number of fields in Table for
                DbiCreateTable with MSSQL
250         Maximum number of fields in Table for
                DbiCreateTable with ODBC, Sybase
253         Maximum number of fields in Table for
                DbiCreateTable with DB2
408         Maximum number of fields used in an Interbase
                Table
1000000     Maximum number of bytes per blob for ODBC

========
2. Paradox Limitations
========

127         Tables open per system
254         Tables open per system (BDE 4.01 & later)
64          Record locks on one table (16Bit) per session
255         Record locks on one table (32Bit) per session
255         Records in transactions on a table (32 Bit)
512         Open physical files
                      (DB, PX, MB, X??, Y??, VAL, TV)
1024        Open physical files
                      (DB, PX, MB, X??, Y??, VAL, TV)
                      (BDE 4.01 & later)
300         Users in one PDOXUSRS.NET file
255         Number of fields per table
255         Size of character fields
2           Billion records in a table
2           Billion bytes in .DB (Table) file
10800       Bytes per record for indexed tables
32750       Bytes per record for non-indexed tables
127         Number of secondary indexes per table
16          Number of fields in an index
255         Concurrent users per table
256         Megabytes of data per BLOb field
100         Passwords per session
15          Password length
63          Passwords per table
159         Fields with validity checks (32 Bit)
63          Fields with validity checks (16 Bit)
81          Maximum characters in path for tables
                     involved in Referential Integrity
25          Field name size in characters
2500        Max. number of entries in a list.
                This impacts drop-lists (combo-boxes).


http://www.thedbcommunity.com/faq/23.htm

Espero haberte ayudado Very Happy
Volver arriba
Ver perfil de usuario Enviar mensaje privado
Mensaje    Asunto: gracias Responder citando

muchas gracias por la respuesta , ma ha servido bastante .

Gracias
Volver arriba
Mostrar mensajes de anteriores:   
Cambiar a:  
No puedes publicar temas nuevos en este foro
No puedes responder a temas en este foro
No puedes editar tus mensajes en este foro
No puedes borrar tus mensajes en este foro
No puedes votar en las encuestas de este foro


Hosting WordPress Indedmedia desde 3,99 €
© 2002–2026 Club Builder · Funciona con phpBB.