Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 4 Using the OIG COM Component : Code Examples

Code Examples
Produces an XML document via the RunXMLDoc method, creates an ADO Recordset object from the RunXMLDoc method's result, and renders it as HTML.
<HTML>
<HEAD><TITLE>Object Integration Gateway COM Example 2</TITLE></HEAD>
<BODY >
<h2>Rows of table BOOKS</h2>
<p>Formating via Simple VB Script</p>
<TABLE BORDER="0">
<%@ LANGUAGE="VBSCRIPT" %>
<%
Dim eSession
Dim fld
Dim rs
' Create an ADO recordset based on the table BOOKS
Set eSession = Server.CreateObject("eCTScom.eCTSsession")
eSession.OpenApplication ,"U=USR40,P=USR40,HOST=USR40"
eSession.RunXMLDoc "BOOKLIST"
Set rs = eSession.GetTableFromDocument("BOOKLIST")
' Display the names of the fields of SCREEN as a title
Response.Write "<TR>"
For Each fld In rs.Fields
Response.Write "<TH bgcolor=PaleGreen>"
Response.Write fld.Name
Response.Write "</TH>"
Next
Response.Write "</TR>"
' Display the rows of BOOKS in a table
While Not rs.EOF
Response.Write "<TR>"
For Each fld In rs.Fields
Response.Write "<TD bgcolor=Wheat>"
Response.Write fld.Value & " "
Response.Write "</TD>"
Next
Response.Write "</TR>"
rs.MoveNext
Wend
' Cleanup the objects created
rs.Close
Set rs = Nothing
eSession.Close
Set eSession = Nothing
%>
</TABLE>
</BODY>
</HTML>

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved