|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
XML/ADO Help Needed
I have been trying for 2 days to get this code to work to no avail. It is receiveing XML from a SQL servver then posting the info to a data island. The problem is that I can't get it to write out the data. I think it is because the Data Island is 'tscensus' and the DATASRC is "tscensus" but I'm not sure. Any help would be greatly appreciated. By the way I do get the XML data when viewing source.
<%@ 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=SRVSQLDEV;User ID=xxxx;Password=xxxx;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 ' Begin Data Island 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> |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > XML/ADO Help Needed |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|