Need help displaying data island

admin

Administrator
Staff member
I have created an ASP that uses brings data from SQL in XML and creates a data island. I can see the data when viewing the source but can't seem to display it. I have worked on this for 2 days now and really need some help. Any ideas why this is not displaying?

<%@ LANGUAGE = VBScript %>
<% Option Explicit %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft FrontPage 5.0"/>
<META HTTP-EQUIV="Content-Type" content="text/html" charset="iso-8859-1"/>
<TITLE>ADO 2.6 E</TITLE>
<!-- #include file="adovbs.inc" -->
<% Response.Write "<H3>Server-side processing</H3>"
Dim adoConn
Set adoConn = Server.CreateObject("ADODB.Connection")
Dim sConn
sConn= "Provider=SQLOLEDB;Data Source=xxxxx;User ID=xxxxx;Password=xxxxx;Initial Catalog=ts_census"
adoConn.ConnectionString = sConn
adoConn.CursorLocation = adUseClient
adoConn.Open
Dim adoCmd
Set adoCmd = Server.CreateObject("ADODB.Command")
Set adoCmd.ActiveConnection = adoConn
Dim sQuery
sQuery = "<ROOT xmlns:sql='urn:schemas-microsoft-com:xml-sql'><sql:query>SELECT WorkstationID, LoginName FROM NC_Workstation FOR XML AUTO</sql:query></ROOT>"
Dim adoStreamQuery
Set adoStreamQuery = Server.CreateObject("ADODB.Stream")
adoStreamQuery.Open
adoStreamQuery.WriteText sQuery, adWriteChar
adoStreamQuery.Position = 0
Set adoCmd.CommandStream = adoStreamQuery
adoCmd.Dialect = "{5D531CB2-E6Ed-11D2-B252-00C04F681B71}"
Response.write "Pushing XML to client for processing " & "<BR/>"
adoCmd.Properties("Output Stream") = Response
Response.write "<XML ID='tscensus'>"
adoCmd.Execute , , adExecuteStream
Response.write "</XML>"
%>
</HEAD>

<BODY>
<TABLE DATASRC="#tscensus" BORDER="1" CELLPADDING="1">
<THEAD>
<TH>Computer Name</TH>
<TH>Login ID</TH>
</THEAD>
<TR>
<TD><SPAN DATAFIELD="WorkstationID"></SPAN></TD>
<TD><SPAN DATAFIELD="LoginName"></SPAN></TD>
</TR>
</TABLE>


</BODY>
</HTML>
 
Back
Top