Consultor Eletrônico



Kbase P87013: How to get the second field when passing a temp-table from Appserver to Delphi?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/16/2008
Status: Unverified

GOAL:

How to get the second field when passing a temp-table from Appserver to Delphi?

GOAL:

How to get data from different fields in a temp-table passed as an output parameter to Delphi ?

FACT(s) (Environment):

OpenEdge 10.x
Progress 9.x

FIX:

The following method of the object CFields can be used:

Item(Variant index)

for example, considering you have 2 Edit Box objects (Edit1 and Edit2):

TempTable := CreateOleObject('Progress.TempTable.2');

AppServer.GetData(TempTable);

for Count1 := 1 to 10 do
begin
TempTable.MoveNext;
Data := TempTable.Fields.Item[1].value[0];
Data2 := TempTable.Fields.Item[2].value[0];
Edit1.Text := Data;
Edit2.Text := Data2;
MessageDlg('Ok for next customer!!', mtInformation,
[mbOk], 0);
end;
TempTable.Close;


Index 1 and Index 2 would be the first and second field defined in your temp-table or a string can be used , for example:

Data := TempTable.Fields.Item['tcustnum'].value[0];
Data2 := TempTable.Fields.Item['tname'].value[0];