Consultor Eletrônico



Kbase P109282: How to pass ROWID from an ActiveX Open Client to the AppServer
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   27/09/2005
Status: Unverified

GOAL:

How to pass ROWID from an ActiveX Open Client to the AppServer

GOAL:

How to call a Progress procedure with a ROWID as INPUT parameter from an ActiveX Open Client

GOAL:

Example of Visual Basic code allowing to call a Progress procedure with a ROWID as INPUT parameter using Open Client

GOAL:

Example of Delphi code allowing to call a Progress procedure with a ROWID as INPUT parameter using Open Client

FACT(s) (Environment):

Progress 9.1x

FIX:

The code below is a Visual Basic code allowing to call a Progress procedure with a ROWID as INPUT parameter:


Visual Basic code:

Dim ao As CaoTestRowid

Dim bRowid(3) As Byte
Dim bFound As Boolean

Set ao = New CaoTestRowid

Call ao.OC_Connect("AppServer://localhost:5162/asbroker1", "", "","")

' Set the ROWID to send
bRowid(0) = 0
bRowid(1) = 0
bRowid(2) = 0
bRowid(3) = 97

Call ao.findRowid(bRowid, bFound)

MsgBox CStr(bFound)

Call ao.OC_Release

The equivalent Delphi code would be:

Procedure TestRowId;
var
bFound: WordBool;
bRowid: Variant;
begin
< ... >
// Set the ROWID to send
bRowid := VarArrayCreate([0, 3], varByte);
bRowid[0] := 0;
bRowid[1] := 0;
bRowid[2] := 0;
bRowid[3] := 97;
ao.findRowid(VarArrayRef(bRowid), bFound); // Pass a reference to the array using VarArrayRef
< ...>

end;


See below the 4GL code (FindRowid.p):

DEFINE INPUT PARAMETER ipRowId AS ROWID NO-UNDO.
DEFINE OUTPUT PARAMETER oplFound AS LOGICAL NO-UNDO INIT FALSE.
FIND FIRST customer WHERE ROWID(customer) = ipRowId NO-LOCK NO-ERROR.
IF AVAILABLE(customer) THEN DO:
oplFound = TRUE.
END.
ELSE DO:
oplFound = FALSE.
END.