Consultor Eletrônico



Kbase P109960: How to call a procedure with an OUTPUT Temp-Table from ASP using the ActiveX Open Client
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/17/2005
Status: Unverified

GOAL:

How to call a procedure with an OUTPUT Temp-Table from ASP using the ActiveX Open Client

GOAL:

How to pass a TEMP-TABLE as an OUTPUT parameter to an ASP program using the ActiveX Open Client

FACT(s) (Environment):

Progress 9.1x

FIX:

The code below allows to send a temp-table, representing the Customer table from the sports2000 database, to an ASP program.

In this sample, it assumes that the AppServer is running on the same machine, and the NameServer's port number is 5162.


4GL Code: (GetCustomer.p)

DEFINE TEMP-TABLE ttCustomer LIKE customer.
DEFINE OUTPUT PARAMETER TABLE FOR ttCustomer .
FOR EACH customer NO-LOCK:
BUFFER-COPY customer TO ttCustomer.
END.

ASP code:

<%@ Language=VBScript %>
<%Option Explicit
Dim oServer
Dim ttCustomer
Set oServer = Server.Createobject("<ProxyName>")

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

set ttCustomer = Server.CreateObject("Progress.TempTable.2")

call oServer.getCustomer(ttCustomer)
%>
<table border="2">
<tr>
<td> <%=ttCustomer.Fields.Item(1).Name %> </td>
<td> <%=ttCustomer.Fields.Item(2).Name %> </td>
<td> <%=ttCustomer.Fields.Item(3).Name %> </td>
<td> <%=ttCustomer.Fields.Item(4).Name %> </td>
<td> <%=ttCustomer.Fields.Item(5).Name %> </td>
<td> <%=ttCustomer.Fields.Item(6).Name %> </td>
</tr>

<% while ttCustomer.MoveNext %>
<tr>
<td> <%=ttCustomer.Fields.Item(1).value(0) %> </td>
<td> <%=ttCustomer.Fields.Item(2).value(0) %> </td>
<td> <%=ttCustomer.Fields.Item(3).value(0) %> </td>
<td> <%=ttCustomer.Fields.Item(4).value(0) %> </td>
<td> <%=ttCustomer.Fields.Item(5).value(0) %> </td>
<td> <%=ttCustomer.Fields.Item(6).value(0) %> </td>
</tr>

<%Wend %>
</table>
<%
Call oServer.OC_Release

set oServer = nothing
%>