XML: a string literal was expected, but no opening quote character was found

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sushweta8
    New Member
    • Feb 2007
    • 9

    XML: a string literal was expected, but no opening quote character was found

    Hi,


    I am using technology:ASP with backend: sql server

    I'm trying to get the sql query results in XML on my asp page, after a while or so, but i get an alert box saying

    XML: a string literal was expected, but no opening quote character was found.

    Any help, guidance, suggestion or solution will be greatly appreciated!

    Thanks in advance,

    Sush
  • vijaydiwakar
    Contributor
    • Feb 2007
    • 579

    #2
    Originally posted by sushweta8
    Hi,


    I am using technology:ASP with backend: sql server

    I'm trying to get the sql query results in XML on my asp page, after a while or so, but i get an alert box saying

    XML: a string literal was expected, but no opening quote character was found.

    Any help, guidance, suggestion or solution will be greatly appreciated!

    Thanks in advance,

    Sush
    just show me the result fetched by thy sql

    Comment

    • sushweta8
      New Member
      • Feb 2007
      • 9

      #3
      Originally posted by vijaydiwakar
      just show me the result fetched by thy sql
      Hi Diwakar,

      The query returns about 1480 rows of 20 columns each, and it takes 51 seconds to give the results, I'm pasting only the first 50 rows here as there is a restriction of max. 10000 characters.

      40 AAAN0001L Charles Dawson Graham Beck Authorised 24/08/2005 NULL 1_1/1 1 1 1 1 1 1 1 Authorised on 24/08/2005 1 NULL NULL 1
      40 AARE0002L Ruediger Zastrow Werner Zoeller Not yet issued NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Not yet issued 0 NULL NULL 1
      50 AARE0003L Ruediger Zastrow Ruediger Zastrow Not applicable NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Not applicable 0 NULL NULL 8
      80 AARE0004L Ruediger Zastrow Ulfert Gartz Not applicable NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Not applicable 1 NULL NULL 7
      80 AARE0005L Ruediger Zastrow Ulfert Gartz Not applicable NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Not applicable 1 NULL NULL 7
      80 AARE0006L Ruediger Zastrow Ulfert Gartz Not applicable NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Not applicable 1 NULL NULL 7
      80 AARE0007L Ruediger Zastrow Ulfert Gartz Not applicable NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Not applicable 1 NULL NULL 7
      40 AARE0008L Ruediger Zastrow Ulfert Gartz Issued, with Ulfert Gartz for completion 05/07/2005 NULL NULL NULL NULL NULL NULL NULL NULL NULL Issued on 05/07/2005, with Ulfert Gartz for completion 1 NULL NULL 1
      80 ABB-0184L Bernie Robertson Bernie Robertson RAF archived / Authorised NULL NULL 1_1/1 1 1 1 1 1 1 NULL RAF archived / Authorised On 23/03/2004 0 NULL NULL 7
      50 ABB-0196L Alan Davies David Vasak Not applicable NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Not applicable 1 NULL NULL 8
      40 ABNB0122L Mike Hunter Richard Harrison Not yet issued NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Not yet issued 1 NULL NULL 1
      80 ABNB0126L Mike Hunter Richard Harrison Not applicable NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Not applicable 1 NULL NULL 7
      40 ABNB0130L Mike Hunter Richard Harrison NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 NULL NULL 1
      40 ABNB0132L Mike Hunter Richard Harrison Not yet issued NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Not yet issued 1 NULL NULL 1
      80 ABNB0141L Fons Kuijpers Richard Harrison Not applicable NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Not applicable 1 NULL NULL 7
      40 ABNB0142L Fons Kuijpers Richard Harrison Not yet issued NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Not yet issued 0 NULL NULL 1
      80 ABNB0144L Fons Kuijpers Richard Harrison Not applicable NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Not applicable 1 NULL NULL 7
      40 ABNB0148L Fons Kuijpers Richard Harrison Authorised 27/11/2003 NULL 1_2/1 2 1 1 1 1 1 NULL Authorised on 27/11/2003 0 NULL NULL 1
      40 ABNB0149L Fons Kuijpers Richard Harrison Authorised 27/11/2003 NULL 1_1/1 1 1 1 1 1 1 NULL Authorised on 27/11/2003 0 NULL NULL 1
      40 ABNB0151L Fons Kuijpers Richard Harrison Authorised 30/09/2003 NULL 1_1/1 1 1 1 1 1 1 NULL Authorised on 30/09/2003 0 NULL NULL 1
      40 ABNB0152L Fons Kuijpers Richard Harrison Authorised 30/09/2003 NULL 1_1/1 1 1 1 1 1 1 NULL Authorised on 30/09/2003 1 NULL NULL 1
      40 ABNB0157L Fons Kuijpers Richard Harrison Authorised 16/02/2004 NULL 1_1/1 1 1 1 1 1 1 NULL Authorised on 16/02/2004 0 NULL NULL 1
      40 ABNB0158L Fons Kuijpers Richard Harrison Authorised 16/02/2004 NULL 1_1/1 1 1 1 1 1 1 NULL Authorised on 16/02/2004 0 NULL NULL 1
      40 ABNB0159L Fons Kuijpers Richard Harrison Authorised 16/02/2004 NULL 1_1/1 1 1 1 1 1 1 NULL Authorised on 16/02/2004 0 NULL NULL 1
      80 ABNB0161L Fons Kuijpers Richard Harrison RAF archived NULL NULL 1_1/1 1 1 1 1 1 1 NULL RAF archived On 25/05/2004 0 NULL NULL 7
      40 ABNB0163L Fons Kuijpers Richard Harrison Authorised 26/03/2004 NULL 1_1/1 1 1 1 1 1 1 NULL Authorised on 26/03/2004 0 NULL NULL 1
      40 ABNB0165L Fons Kuijpers Richard Harrison Authorised 26/04/2004 NULL 1_1/1 1 1 1 1 1 1 NULL Authorised on 26/04/2004 0 NULL NULL 1
      40 ABNB0166L Fons Kuijpers Richard Harrison Authorised 26/04/2004 NULL 1_1/1 1 1 1 1 1 1 NULL Authorised on 26/04/2004 0 NULL NULL 1
      40 ABNB0167L Fons Kuijpers Richard Harrison Authorised 23/04/2004 NULL 1_1/1 1 1 1 1 1 1 NULL Authorised on 23/04/2004 0 NULL NULL 1
      40 ABNB0169L Fons Kuijpers Richard Harrison Authorised 02/08/2004 NULL 1_1/1 1 1 1 1 1 1 1 Authorised on 02/08/2004 0 NULL NULL 1
      80 ABNB0171L Fons Kuijpers Richard Harrison Not applicable NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Not applicable 0 NULL NULL 7
      40 ABNB0172L Fons Kuijpers Richard Harrison Authorised 26/11/2004 NULL 1_1/1 1 1 1 1 1 1 1 Authorised on 26/11/2004 0 NULL NULL 1
      40 ABNB0173L Fons Kuijpers Richard Harrison Authorised 01/11/2004 NULL 1_1/1 1 1 1 1 1 1 1 Authorised on 01/11/2004 0 NULL NULL 1
      40 ABNB0175L Fons Kuijpers Richard Harrison Authorised 26/11/2004 NULL 1_1/1 1 1 1 1 1 1 1 Authorised on 26/11/2004 0 NULL NULL 1
      40 ABNB0179L Richard Harrison Willem van Asperen Authorised 17/11/2005 NULL 2_1/3 1 3 1 3 1 1 1 Authorised on 17/11/2005 0 NULL NULL 1
      80 ABNB0184L Richard Harrison Richard Inman Not applicable NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Not applicable 0 NULL NULL 7
      80 ABSA0005L Scott Hamilton Jim Deal Not applicable NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Not applicable 0 NULL NULL 7
      80 ABYN0026L Paul Dyson Greg Jones Not applicable NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Not applicable 0 NULL NULL 7
      80 ABYN0027L Paul Dyson Greg Jones Not applicable NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Not applicable 1 NULL NULL 7
      80 ABYN0043L Paul Dyson NULL Not applicable NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Not applicable 0 NULL NULL 7
      80 ABYN0046L Paul Dyson Paul Dyson Not applicable NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Not applicable 0 NULL NULL 7
      10 ABYN0052L Scott Hamilton Richard Inman Not yet issued NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Not yet issued 0 NULL NULL 4
      80 ABZ-0001L Fons Kuijpers Michael Stockkamp Not applicable NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Not applicable 1 NULL NULL 7
      40 ACCE0001L Scott Hamilton NULL Authorised 14/10/2005 NULL 1_1/1 1 1 1 1 1 1 1 Authorised on 14/10/2005 0 NULL NULL 1
      30 ADGH0002L Claus Nehmzow Bjoern Beermann Authorised 13/02/2007 NULL 1_1/1 1 1 1 1 1 1 1 Authorised on 13/02/2007 1 NULL NULL 2
      80 ADGH0003L Claus Nehmzow Bjoern Beermann Not applicable NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Not applicable 1 NULL NULL 7
      80 ADIN0019L Paul Dyson Richard Inman Not applicable NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Not applicable 1 NULL NULL 7
      80 ADPS0001L Claus Nehmzow Michael Stockkamp Not applicable NULL 11/10/2005 2_3/1 3 1 1 1 1 1 1 Not applicable 1 NULL NULL 7
      60 ADPS0005L Claus Nehmzow Bjoern Beermann Not applicable NULL 22/12/2005 1_1/1 1 1 1 1 1 1 1 Not applicable 1 NULL NULL 6
      40 ADPS0009L Claus Nehmzow Bjoern Beermann Authorised 14/03/2006 NULL 1_1/1 1 1 1 1 1 1 1 Authorised on 14/03/2006 1 NULL NULL 1


      Let me know what else I need to mention.....

      Thanks,
      sush

      Comment

      • sushweta8
        New Member
        • Feb 2007
        • 9

        #4
        Also pasting the code sample below

        Code:
        <%
        Response.Buffer = true
        Response.Expires=-1444
        Response.CacheControl = "no-cache"
        Server.ScriptTimeout=10000
        Response.CharSet="windows-1252"
        Response.ContentType="text/xml"
        
        Dim oXMLOutput,oElement,oRs,oCn,iCount,sValue, sCols, iArrayCount, bExists, bLogonPracticeExists
        
        Set oCn = server.CreateObject("ADODB.Connection")
        Set oRs = server.CreateObject("ADODB.Recordset")
        set oXMLOutput=server.CreateObject("MSXML2.DOMDocument")
        
        'connect to the database
        oCn.Open Application("gsConnection")
        
        'fetch all the records into the recordset
        set oRs=oCn.Execute("gs_get_riskoverview_revised '" & sCriteria & "','" & sData & "','" & sNT_ID & "','" & sStage & "','" & dtStart & "','" & dtEnd & "'")
        
        'sPage name is passed from the corresponding pages from where this page is called through XMLHTTP
        
        select case sPage
        
        case "Overview"
        
        sCols="CURRENT_STAGE,SORT_STAGE,SALES_PROSPECT_CODE,PARTNER_NAME,MANAGER_NAME,RAF_STATUS,LATEST_RAF,COMBINED_OVERALL_RISK,RESEND,ACTIONS"
        
        sCols=split(sCols,",")
        
        end select
        
        'load the dom object
        oXMLOutput.loadXML("<ROWS/>")
        
        'used for inserting an attribute which is not present in the database
        bExists=0
        
        'used for checking the existence of logon users practice
        bLogonPracticeExists=0
        
        do while not oRs.EOF
        	Set oElement = oXMLOutput.createElement("ROW")
        	oXMLOutput.selectSingleNode("//ROWS").appendChild oElement
        	for iArrayCount=lbound(sCols) to ubound(sCols)
        		for iCount=0 to oRs.Fields.Count-1
        			if sCols(iArrayCount)=oRs.Fields(iCount).Name then
        				if oRs.Fields(iCount).Value=NULL or IsNull(oRs.Fields(iCount).Value) then
        					sValue=""
        				else
        					sValue=oRs.Fields(iCount).Value
        				end if
        				oElement.setAttribute oRs.Fields(iCount).Name,sValue
        				bExists=1
        				exit for
        			end if
        		next
        		if bExists=0 then
        			oElement.setAttribute sCols(iArrayCount),""
        		end if
        		'reset
        		bExists=0
        	next
        	
        	'check if the logon user practice is present in the recordset
        	'if no then add it in the xml string	
        	if sPage="PracticeLoc" or sPage="PracticeGlob" then
        		if oRs("UNIT_CODE")=sPracticeCode then
        			bLogonPracticeExists=1
        		end if
        	end if
        	oRs.MoveNext
        loop
        
        'if the flag bLogonPracticeExists=0 then the recordset has not retrieved 
        'the logon users practice hence added it to the xml string
        if (sPage="PracticeLoc" or sPage="PracticeGlob") and bLogonPracticeExists=0 then
        	Set oElement = oXMLOutput.createElement("ROW")
        	oXMLOutput.selectSingleNode("//ROWS").appendChild oElement
        	oElement.setAttribute "UNIT_CODE",sPracticeCode
        	oElement.setAttribute "UNIT_NAME",sDescription
        end if
        
        %>
        <?xml version="1.0" encoding="windows-1252"?>
        <%
        Response.Write oXMLOutput.xml
        
        set oXMLOutput=Nothing
        set oCn=Nothing
        set oRs=Nothing
        %>

        Comment

        • sushweta8
          New Member
          • Feb 2007
          • 9

          #5
          Please remove this thread

          Comment

          Working...