Ver Mensaje Individual
  #8  
Antiguo 15-07-2007
7pilas 7pilas is offline
Registrado
 
Registrado: abr 2006
Posts: 7
Reputación: 0
7pilas Va por buen camino
no entiendo

aun soy nuevo en esto y no entiendo bien lo de

Código Delphi [-]
procedure TForm_BeEMPPRJ.Table2BeforePost(DataSet: TDataSet);
begin
if (Table2.State = dsInsert) then
begin
Table2.Value := Table1.FieldByName('LINK_0001').AsFloat;
ASSEMBLY_RECORD_MaxKey(Table2, 'LINK_0002');

// Init_VALUES_TABLE
Table2Edit;
if (Table2Producto.IsNULL) then
Table2Producto.Value := '';
end;
end;

// Versión: 10.0000 - © 1980, 2006 For Tables DELPHI SERVER .DB
// Ejecutar en: El Evento  ****
// Función que Extrae el Valor Maximo para un Nuevo Registro Key
// Con este Procedimiento ya no se Necesita Utilizar las Tablas: // Ejemplos:
// Form_DDBTLM.ASSEMBLY_RECORD_MaxKey(Table_NN, 'LINK_0001');
// Form_DDBTLM.ASSEMBLY_RECORD_MaxKey(Table_NN, 'LINK_0002');
// Form_DDBTLM.ASSEMBLY_RECORD_MaxKey(Table_NN, 'LINK_0003');

procedure TForm_BeEMPPRJ.ASSEMBLY_RECORD_MaxKey(var pmt_TABLE: TTable; pmt_FIELD: string);
begin
// Init_PROPERTIES
if (Table_ARMK.Active) then Table_ARMK.Close;
Table_ARMK.Filter := '';
Table_ARMK.Filtered := False;
Table_ARMK.IndexFieldNames := '';
Table_ARMK.MasterFields := '';
Table_ARMK.MasterSource := nil;
// Assign_PROPERTIES
Table_ARMK.DatabaseName := pmt_TABLE.DatabaseName;
Table_ARMK.SessionName := pmt_TABLE.SessionName;
Table_ARMK.TableName := pmt_TABLE.TableName;
Table_ARMK.MasterSource := pmt_TABLE.MasterSource;
Table_ARMK.MasterFields := pmt_TABLE.MasterFields;
if (Table_ARMK.MasterFields = '') then
Table_ARMK.IndexFieldNames := pmt_FIELD
else
Table_ARMK.IndexFieldNames := Table_ARMK.MasterFields + ';' + pmt_FIELD;
// Open_TABLE
Table_ARMK.Open;
Table_ARMK.Last;
// Load_RECORD_KEY
if (Table_ARMK.RecordCount = 0) then
pmt_TABLE.FieldByName(pmt_FIELD).AsFloat := 1
else
pmt_TABLE.FieldByName(pmt_FIELD).AsFloat := Table_ARMK.FieldByName(pmt_FIELD).AsFloat + 1;
// Close_TABLE
Table_ARMK.Close;
end;
no entiendo el funcionamiento de eso.....
Responder Con Cita