Ver Mensaje Individual
  #1  
Antiguo 27-09-2005
javicho_villa javicho_villa is offline
Miembro
 
Registrado: feb 2005
Ubicación: Lima - Perú
Posts: 105
Reputación: 20
javicho_villa Va por buen camino
Talking Creacion de Indices en ejecucion

Hola a Todos: gracias por la atencion prestada, tengo un problema cuando creo una tabla en tiempo de ejecucion, solo para crear el indice primario, el error que sale o es violacion de llaves o tabla no existe, si alguien me puede ayudar se lo voy a gradecer infinitamente.

Aqui el codigo usado:

//---- Creando una tabla temporal para el detalle de la boleta ----///
Código Delphi [-]
DM.TemporalTable.Close;
 Dm.TemporalTable.TableType := ttParadox;
 Numero := 1;
 MiTabla := '_TEMP_';
 lencontro := false;
 while lencontro=false do begin
 Dm.TemporalTable.TableName := MiTabla+Trim(IntToStr(Numero));
 if Dm.TemporalTable.Exists then Numero := Numero + 1
 else lencontro := true;
 end;
 with Dm.TemporalTable.FieldDefs do
 begin
 Clear;
 Add('Id_Boleta', ftInteger, 0, True);
 Add('Id_Temp', ftInteger, 0, FALSE);
 Add('Uno', ftString, 30, FALSE);
 Add('Dos' , ftFloat, 0, FALSE);
 Add('Tres', ftFloat, 0, FALSE);
 Add('Cuatro', ftString, 30, FALSE);
 Add('Cinco', ftFloat, 0, FALSE);
 Add('Seis', ftFloat, 0, FALSE);
 Add('Siete', ftString, 30, FALSE);
 Add('Ocho', ftFloat, 0, FALSE);
 Add('Nueve', ftFloat, 0, FALSE);
 end;
 Dm.TemporalTable.Exclusive := true;
 Dm.TemporalTable.IndexDefs.Clear;
 with Dm.TemporalTable.IndexDefs.AddIndexDef do begin
 Name := '';
 Fields := 'Id_Boleta';
 Options := [ixPrimary];
 end;
 Dm.TemporalTable.CreateTable;
 Dm.TemporalTable.Active := true;
 Dm.TemporalTable.FieldDefs.Update;
Donde Dm es el Data Module

Última edición por marcoszorrilla fecha: 28-09-2005 a las 07:03:11. Razón: Añadir etiquetas Delphi
Responder Con Cita