Consultor Eletrônico



Kbase P18543: OPEN CLIENT: Passing Temp-Tables to the AppServer using ActiveX Data Objects (ADO) and no record app
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   9/26/2006
Status: Verified

FACT(s) (Environment):

Progress 9.x

SYMPTOM(s):

Passing temp-tables to the AppServer using ActiveX Data Objects (ADO)

No data appears in the temp-table on the AppServer side

CAUSE:

After data was added to the ADO Recordset the record pointer was not moved to the beginning of the Recordset

FIX:

When using either ADO (ActiveX Data Objects) or DAO (Data Access Objects) to hold the data being passed to a 4GL program running on the AppServer via Open Client it is important to understand that the records we send to the AppServer are based on the current record pointer position in the ADO or DAO recordset.

If you want to pass the entire contents of the ADO or DAO recordset to the AppServer then you must invoke the MoveFirst() and MovePrevious() methods to move the record pointer so that it is before the first record in the recordset. Doing this is the only way to ensure that the entire recordset is passed to the AppServer.

For example, in Visual Basic it looks like the gollowing:
' < ... >
Set rs = CreateObject("ADOR.Recordset")
Call rs.Fields.Append("AcctNum", adInteger)
Call rs.Fields.Append("Amount", adDouble)
Call rs.Fields.Append("StartDate", adDate)
Call rs.Open(, , adOpenDynamic)
Call rs.AddNew("AcctNum", 1)
Call rs.Update("Amount", 1000.11)
Call rs.Update("StartDate", 10 / 26 / 53)
Call rs.AddNew("AcctNum", 2)
Call rs.Update("Amount", 2000.22)
Call rs.Update("StartDate", 1 / 1 / 2000)
Set ProTT = New CProTempTable
rs.MoveFirst
rs.MovePrevious
ProTT.DataSource = rs

' < ... >