Re: FOR XML AUTO - Cutting off XML

From: Roji. P. Thomas (lazydragon_at_nowhere.com)
Date: 03/16/04


Date: Tue, 16 Mar 2004 18:10:20 +0530

Are you talking abt seeing the results in QA?

-- 
Roji. P. Thomas
SQL Server Programmer
"Andrew Banks" <banksy@nospamblueyonder.co.uk> wrote in message
news:GnC5c.17968$r53.389994645@news-text.cableinet.net...
> I'm using Classic ASP with SQL Server to read in XML data.
>
> If I return about 5 records everything seems fine but returning 10
records,
> the XML seems to cut off towards the end. Is this a problem people have
come
> across before and if so how can I correct it?
>
> Code and sample output below
>
> ASP-----
> <%
> Set objConn = Server.CreateObject("ADODB.Connection")
> objConn.ConnectionString = "dsn=SERVER;uid=sa;"
> objConn.Open strSQL = "SELECT * FROM viewPhoneBook FOR XML AUTO"
> Set objRS = Server.CreateObject("ADODB.Recordset")
> objRS.Open strSQL, objConn
> Response.Write("<?xml version='1.0' encoding='UTF-8'?>")
> Response.Write("<root>")
> Response.Write(objRS(0))
> Response.Write("</root>")
> Set objRS = Nothing
> Set objConn = Nothing
> %>
>
> XML------
> <?xml version='1.0' encoding='UTF-8'?>
> <root>
> <viewPhoneBook CompanyName="A Company" DepartmentName="Location 1
> Administration" OfficeName="Location 1" OfficePhone="0000 000 0000"
> OfficeFax="0000 000 0000" UserID="J.Forbes" FName="John" LName="Forbes"
> Mobile="123456" Extension="1234" FirstAid="1" FireWarden="0"/>
> <viewPhoneBook CompanyName="A Company" DepartmentName="Location 1
> Administration" OfficeName="Location 1" OfficePhone="0000 000 0000"
> OfficeFax="0000 000 0000" UserID="furious5" FName="Mike" LName="Howarth"
> Mobile="123456" Extension="1234" FirstAid="1" FireWarden="1"/>
> <viewPhoneBook CompanyName="A Company" DepartmentName="Location 1
> Administration" OfficeName="Location 1" OfficePhone="0000 000 0000"
> OfficeFax="0000 000 0000" UserID="J.Matthews" FName="James"
LName="Matthews"
> Mobile="123456" Extension="1233" FirstAid="0" FireWarden="0"/>
> <viewPhoneBook CompanyName="A Company" DepartmentName="Location 1
> Administration" OfficeName="Location 1" OfficePhone="0000 000 0000"
> OfficeFax="0000 000 0000" UserID="L.Robinson" FName="Lee" LName="Robinson"
> Mobile="123654" Extension="3211" FirstAid="1" FireWarden="1"/>
> <viewPhoneBook CompanyName="A Company" DepartmentName="Location 1
> Administration" OfficeName="Location 1" OfficePhone="0000 000 0000"
> OfficeFax="0000 000 0000" UserID="D.Hopkins" FName="Dave" LName="Hopkins"
> Mobile="654788" Extension="6666" FirstAid="1" FireWarden="0"/>
> <viewPhoneBook CompanyName="A Company" DepartmentName="Location 2
> Administration" OfficeName="Location 2" OfficePhone="0000 000 0000"
> OfficeFax="0000 000 0000" UserID="E.Hopkins" FName="Edward"
LName="Hopkins"
> Mobile="656" Extension="5555" FirstAid="0" FireWarden="0"/>
> <viewPhoneBook CompanyName="A Company" DepartmentName="Location 2
> Administration" OfficeName="Location 2" OfficePhone="0000 000 0000"
> OfficeFax="0000 000 0000" UserID="L.Moorhouse" FName="Leanne"
> LName="Moorhouse" Mobile="654899" Extension="3322" FirstAid="1"
> FireWarden="1"/>
> <viewPhoneBook C
> ####THIS IS WHERE THE XML OUTPUT FROM SQL SERVER CUTS OFF</root>
>
>


Relevant Pages

  • Re: Problems retrieving image from SQL server
    ... display it on an ASP page. ... Set objConn = Server.CreateObject ... Set objRS = Server.CreateObject ... The original images were added to SQL server through an Access front end, ...
    (microsoft.public.inetserver.asp.db)
  • Connect SQL database through ASP
    ... I have SQL Server 2000 installed on my machine and tried ... to develop asp script to connect to the server database ... Set objConn = Server.CreateObject ... Set objRS = Server.CreateObject ...
    (microsoft.public.sqlserver.connect)
  • Lookup executes 3 time upon Recordset.Save
    ... executed three times (tested on SQL Server 2000 and 2005 using both sqloledb ... and drivers): ... Set objConn = Server.CreateObject ... INTO DebugLog VALUES; ...
    (microsoft.public.data.ado)
  • Lookup executes 3 time upon Recordset.Save
    ... executed three times (tested on SQL Server 2000 and 2005 using both sqloledb ... and drivers): ... Set objConn = Server.CreateObject ... INTO DebugLog VALUES; ...
    (microsoft.public.data.ado)
  • connect to sql server
    ... I can connect to my database with everything but my ASP page. ... SQL Server does not exist or access denied" ... the connection string is: ... Set objconn = Server.CreateObject ...
    (microsoft.public.sqlserver.programming)