Click to See Complete Forum and Search --> : Need help displaying data island


rparsons
04-10-2003, 10:24 AM
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>

khalidali63
04-10-2003, 01:42 PM
You use VBScript / ASP I am not well versed in that therefore can not point your error.
However ,below is the link that uses XMLIsland in IE and displays a list of elements

http://68.145.35.86/skills/javascripts/xmlstuff/ParseXML.html

Cheers

Khalid

devinabox
04-13-2003, 12:10 PM
A preliminary suggestion would be to check the case of the field names in the XML object, and in your table...xml is case sensitive, so that cna cause problems.

Can you post a sample of the output XML from your script?

rparsons
04-14-2003, 08:21 AM
<XML ID='tscensus'>
<ROOT xmlns:sql="urn:schemas-microsoft-com:xml-sql">
<NC_Workstation WorkstationID="KLST26815" LoginName="username1" />
<NC_Workstation WorkstationID="Lost and Found" />
<NC_Workstation WorkstationID="COLT23962" LoginName="username2" />
</ROOT>
</XML>



NOTE the singe quote on the ID..This appears like it would be a problem.