DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 9 of 9

Thread: Build Centralized VB, XML Apps Error: Suggestions?

  1. #1
    john g Guest

    Build Centralized VB, XML Apps Error: Suggestions?


    I have set up the "Build Centralized Apps with VB and XML" download app on
    my pc (WINNT4, sp6a, V Studio 6 Ent, ADO 2.5, msxml3.dll (replace mode) IIS4,
    SQL 7 sp2).

    I get an error in both the VB and ASP clients when "R.Open (xml) or (xhttp.responseXML)"
    are called. the error reads "A string literal was expected, but no opening
    quote character was found."
    I have not modified the code (but for the url, and the connect string).

    I'm sure its something foolish, but I've run out of workarounds.
    I'd love to add XML to VB, but so far I can't get anything useful to work!
    Some tips would be greatly appeciated.

    Thanks....
    j

  2. #2
    Russell Jones Guest

    Re: Build Centralized VB, XML Apps Error: Suggestions?

    The problem stems from the fact that you can't persist the recordset
    directly to the Response object in IIS 4. You need to modify the getData.asp
    file. Here's a workaround. Save the Recordset to a DOMDocument object on the
    server, and then send the XML back via the xml property with an xml
    declaration appended to the string.

    set xml = server.CreateObject("msxml2.domdocument")
    R.Save xml, 1
    if err.number <> 0 then
    call responseError("Recordset Save Error on command '" & CommandText & "':
    " & Err.Description)
    Response.end
    else
    Response.write "<?xml version=""1.0"" encoding=""ISO-8859-1""?>" &
    xml.xml
    end if

    Also, thanks to Michael Waddell for finding this: There are some missing
    quotes around the first <script> line in the ASP file. The line should read:
    connectionStringSet = (lcase("<%=Application("ConnectionString")%>") <>
    "changeme")

    Note that this line, and the subsequent tests for the connectionStringSet
    value in the script are only there to make sure that people using the sample
    code actually provide a value. They don't need to be there if you remember
    to create a valid connection string on the server, and in fact, leaving them
    in the code is a security hazard, because the string shows up via View
    Source in the browser.

    Sorry about the problems. This should help.

    Russell Jones
    Sr. Web Development Editor
    DevX.com



    "john g" <grevillej@acklands.ca> wrote in message
    news:3aa69e7a$1@news.devx.com...
    >
    > I have set up the "Build Centralized Apps with VB and XML" download app on
    > my pc (WINNT4, sp6a, V Studio 6 Ent, ADO 2.5, msxml3.dll (replace mode)

    IIS4,
    > SQL 7 sp2).
    >
    > I get an error in both the VB and ASP clients when "R.Open (xml) or

    (xhttp.responseXML)"
    > are called. the error reads "A string literal was expected, but no opening
    > quote character was found."
    > I have not modified the code (but for the url, and the connect string).
    >
    > I'm sure its something foolish, but I've run out of workarounds.
    > I'd love to add XML to VB, but so far I can't get anything useful to work!
    > Some tips would be greatly appeciated.
    >
    > Thanks....
    > j




  3. #3
    John Greville Guest

    Re: Build Centralized VB, XML Apps Error: Suggestions?


    Thanks for the assistance Russell!
    I changed the code, but now I get the error: "Stream object cannot be read
    because it is empty....".
    Below is the debug output:

    <font face="Arial" size=2>
    <p>Microsoft VBScript compilation </font> <font face="Arial" size=2>error
    '800a03ea'</font>
    <p>
    <font face="Arial" size=2>Syntax error</font>
    <p>
    <font face="Arial" size=2>/XHTTPRequest/getData.asp</font><font face="Arial"
    size=2>, line 153</font>
    <pre>Response.write &quot;&lt;?xml version=&quot;&quot;1.0&quot;&quot; encoding=&quot;&quot;ISO-8859-1&quot;&quot;?&gt;&quot;
    &amp;
    ------------------------------------------------------------------^</pre>

    DOMDocument

    (Debug ends)
    As a Newbie to XML I'm not sure about the Response.write. Is it correct?
    Regards.
    John Greville

    "Russell Jones" <arj1@northstate.net> wrote:
    >The problem stems from the fact that you can't persist the recordset
    >directly to the Response object in IIS 4. You need to modify the getData.asp
    >file. Here's a workaround. Save the Recordset to a DOMDocument object on

    the
    >server, and then send the XML back via the xml property with an xml
    >declaration appended to the string.
    >
    >set xml = server.CreateObject("msxml2.domdocument")
    > R.Save xml, 1
    >if err.number <> 0 then
    > call responseError("Recordset Save Error on command '" & CommandText &

    "':
    >" & Err.Description)
    > Response.end
    >else
    > Response.write "<?xml version=""1.0"" encoding=""ISO-8859-1""?>" &
    >xml.xml
    >end if
    >
    >Also, thanks to Michael Waddell for finding this: There are some missing
    >quotes around the first <script> line in the ASP file. The line should read:
    >connectionStringSet = (lcase("<%=Application("ConnectionString")%>") <>
    >"changeme")
    >
    >Note that this line, and the subsequent tests for the connectionStringSet
    >value in the script are only there to make sure that people using the sample
    >code actually provide a value. They don't need to be there if you remember
    >to create a valid connection string on the server, and in fact, leaving

    them
    >in the code is a security hazard, because the string shows up via View
    >Source in the browser.
    >
    >Sorry about the problems. This should help.
    >
    >Russell Jones
    >Sr. Web Development Editor
    >DevX.com
    >
    >
    >
    >"john g" <grevillej@acklands.ca> wrote in message
    >news:3aa69e7a$1@news.devx.com...
    >>
    >> I have set up the "Build Centralized Apps with VB and XML" download app

    on
    >> my pc (WINNT4, sp6a, V Studio 6 Ent, ADO 2.5, msxml3.dll (replace mode)

    >IIS4,
    >> SQL 7 sp2).
    >>
    >> I get an error in both the VB and ASP clients when "R.Open (xml) or

    >(xhttp.responseXML)"
    >> are called. the error reads "A string literal was expected, but no opening
    >> quote character was found."
    >> I have not modified the code (but for the url, and the connect string).
    >>
    >> I'm sure its something foolish, but I've run out of workarounds.
    >> I'd love to add XML to VB, but so far I can't get anything useful to work!
    >> Some tips would be greatly appeciated.
    >>
    >> Thanks....
    >> j

    >
    >



  4. #4
    John Greville Guest

    Re: Build Centralized VB, XML Apps Error: Suggestions?


    Plan "B": I put the original code (with fixed quotes) on a WIN2K IE5 server,
    and got the same error message as below.
    Hmm....


    "John Greville" <grevillej@acklands.ca> wrote:
    >
    >Thanks for the assistance Russell!
    >I changed the code, but now I get the error: "Stream object cannot be read
    >because it is empty....".
    >Below is the debug output:
    >
    > <font face="Arial" size=2>
    ><p>Microsoft VBScript compilation </font> <font face="Arial" size=2>error
    >'800a03ea'</font>
    ><p>
    ><font face="Arial" size=2>Syntax error</font>
    ><p>
    ><font face="Arial" size=2>/XHTTPRequest/getData.asp</font><font face="Arial"
    >size=2>, line 153</font>
    ><pre>Response.write "<?xml version=""1.0"" encoding=""ISO-8859-1""?>"
    >&
    >------------------------------------------------------------------^</pre>
    >
    >DOMDocument
    >
    >(Debug ends)
    >As a Newbie to XML I'm not sure about the Response.write. Is it correct?
    >Regards.
    >John Greville
    >
    >"Russell Jones" <arj1@northstate.net> wrote:
    >>The problem stems from the fact that you can't persist the recordset
    >>directly to the Response object in IIS 4. You need to modify the getData.asp
    >>file. Here's a workaround. Save the Recordset to a DOMDocument object on

    >the
    >>server, and then send the XML back via the xml property with an xml
    >>declaration appended to the string.
    >>
    >>set xml = server.CreateObject("msxml2.domdocument")
    >> R.Save xml, 1
    >>if err.number <> 0 then
    >> call responseError("Recordset Save Error on command '" & CommandText

    &
    >"':
    >>" & Err.Description)
    >> Response.end
    >>else
    >> Response.write "<?xml version=""1.0"" encoding=""ISO-8859-1""?>" &
    >>xml.xml
    >>end if
    >>
    >>Also, thanks to Michael Waddell for finding this: There are some missing
    >>quotes around the first <script> line in the ASP file. The line should

    read:
    >>connectionStringSet = (lcase("<%=Application("ConnectionString")%>") <>
    >>"changeme")
    >>
    >>Note that this line, and the subsequent tests for the connectionStringSet
    >>value in the script are only there to make sure that people using the sample
    >>code actually provide a value. They don't need to be there if you remember
    >>to create a valid connection string on the server, and in fact, leaving

    >them
    >>in the code is a security hazard, because the string shows up via View
    >>Source in the browser.
    >>
    >>Sorry about the problems. This should help.
    >>
    >>Russell Jones
    >>Sr. Web Development Editor
    >>DevX.com
    >>
    >>
    >>
    >>"john g" <grevillej@acklands.ca> wrote in message
    >>news:3aa69e7a$1@news.devx.com...
    >>>
    >>> I have set up the "Build Centralized Apps with VB and XML" download app

    >on
    >>> my pc (WINNT4, sp6a, V Studio 6 Ent, ADO 2.5, msxml3.dll (replace mode)

    >>IIS4,
    >>> SQL 7 sp2).
    >>>
    >>> I get an error in both the VB and ASP clients when "R.Open (xml) or

    >>(xhttp.responseXML)"
    >>> are called. the error reads "A string literal was expected, but no opening
    >>> quote character was found."
    >>> I have not modified the code (but for the url, and the connect string).
    >>>
    >>> I'm sure its something foolish, but I've run out of workarounds.
    >>> I'd love to add XML to VB, but so far I can't get anything useful to

    work!
    >>> Some tips would be greatly appeciated.
    >>>
    >>> Thanks....
    >>> j

    >>
    >>

    >



  5. #5
    Russell Jones Guest

    Re: Build Centralized VB, XML Apps Error: Suggestions?

    John:

    It sounds like you're not getting any data back from the query--e.g. the
    Recordset is empty. I can duplicate your error by calling a query that
    doesn't return data.

    Thanks,
    Russell Jones

    "John Greville" <grevillej@acklands.ca> wrote in message
    news:3aa7d521$1@news.devx.com...
    >
    > Plan "B": I put the original code (with fixed quotes) on a WIN2K IE5

    server,
    > and got the same error message as below.
    > Hmm....
    >
    >
    > "John Greville" <grevillej@acklands.ca> wrote:
    > >
    > >Thanks for the assistance Russell!
    > >I changed the code, but now I get the error: "Stream object cannot be

    read
    > >because it is empty....".
    > >Below is the debug output:
    > >
    > > <font face="Arial" size=2>
    > ><p>Microsoft VBScript compilation </font> <font face="Arial" size=2>error
    > >'800a03ea'</font>
    > ><p>
    > ><font face="Arial" size=2>Syntax error</font>
    > ><p>
    > ><font face="Arial" size=2>/XHTTPRequest/getData.asp</font><font

    face="Arial"
    > >size=2>, line 153</font>
    > ><pre>Response.write "<?xml version=""1.0"" encoding=""ISO-8859-1""?>"
    > >&
    > >------------------------------------------------------------------^</pre>
    > >
    > >DOMDocument
    > >
    > >(Debug ends)
    > >As a Newbie to XML I'm not sure about the Response.write. Is it correct?
    > >Regards.
    > >John Greville
    > >
    > >"Russell Jones" <arj1@northstate.net> wrote:
    > >>The problem stems from the fact that you can't persist the recordset
    > >>directly to the Response object in IIS 4. You need to modify the

    getData.asp
    > >>file. Here's a workaround. Save the Recordset to a DOMDocument object on

    > >the
    > >>server, and then send the XML back via the xml property with an xml
    > >>declaration appended to the string.
    > >>
    > >>set xml = server.CreateObject("msxml2.domdocument")
    > >> R.Save xml, 1
    > >>if err.number <> 0 then
    > >> call responseError("Recordset Save Error on command '" & CommandText

    > &
    > >"':
    > >>" & Err.Description)
    > >> Response.end
    > >>else
    > >> Response.write "<?xml version=""1.0"" encoding=""ISO-8859-1""?>" &
    > >>xml.xml
    > >>end if
    > >>
    > >>Also, thanks to Michael Waddell for finding this: There are some missing
    > >>quotes around the first <script> line in the ASP file. The line should

    > read:
    > >>connectionStringSet = (lcase("<%=Application("ConnectionString")%>") <>
    > >>"changeme")
    > >>
    > >>Note that this line, and the subsequent tests for the

    connectionStringSet
    > >>value in the script are only there to make sure that people using the

    sample
    > >>code actually provide a value. They don't need to be there if you

    remember
    > >>to create a valid connection string on the server, and in fact, leaving

    > >them
    > >>in the code is a security hazard, because the string shows up via View
    > >>Source in the browser.
    > >>
    > >>Sorry about the problems. This should help.
    > >>
    > >>Russell Jones
    > >>Sr. Web Development Editor
    > >>DevX.com
    > >>
    > >>
    > >>
    > >>"john g" <grevillej@acklands.ca> wrote in message
    > >>news:3aa69e7a$1@news.devx.com...
    > >>>
    > >>> I have set up the "Build Centralized Apps with VB and XML" download

    app
    > >on
    > >>> my pc (WINNT4, sp6a, V Studio 6 Ent, ADO 2.5, msxml3.dll (replace

    mode)
    > >>IIS4,
    > >>> SQL 7 sp2).
    > >>>
    > >>> I get an error in both the VB and ASP clients when "R.Open (xml) or
    > >>(xhttp.responseXML)"
    > >>> are called. the error reads "A string literal was expected, but no

    opening
    > >>> quote character was found."
    > >>> I have not modified the code (but for the url, and the connect

    string).
    > >>>
    > >>> I'm sure its something foolish, but I've run out of workarounds.
    > >>> I'd love to add XML to VB, but so far I can't get anything useful to

    > work!
    > >>> Some tips would be greatly appeciated.
    > >>>
    > >>> Thanks....
    > >>> j
    > >>
    > >>

    > >

    >




  6. #6
    Dave Fitzgerald Guest

    Re: Build Centralized VB, XML Apps Error: Suggestions?


    Hi Russell;
    It looks like I'm running into a similar but slightly different problem than
    what John G gets my debug is producing the following.
    <font face="Arial" size=2>
    <p>ADODB.Recordset</font> <font face="Arial" size=2>error '800a0bb9'</font>
    <p>
    <font face="Arial" size=2>Arguments are of the wrong type, are out of acceptable
    range, or are in conflict with one another.</font>
    <p>
    <font face="Arial" size=2>/XMLTest/getData.asp</font><font face="Arial" size=2>,
    line 150</font>
    I haven't modified getdata.asp as you indicated to John G because I'm not
    clear what line(s) should be modified where this code snippet should be inserted.
    Any chance that you could provide a corrected version of getdata.asp? Thanks

  7. #7
    Russell Jones Guest

    Re: Build Centralized VB, XML Apps Error: Suggestions?

    Dave:

    To modify getdata.asp, remove or comment out the line that reads: R.save,
    adPersistXML, and replace it with the modifications from my previous post,
    which will make the page run properly on IIS 4.

    Thanks,
    Russell



    "Dave Fitzgerald" <david.fitzgerald@inforonics.com> wrote in message
    news:3aa91d0f@news.devx.com...
    >
    > Hi Russell;
    > It looks like I'm running into a similar but slightly different problem

    than
    > what John G gets my debug is producing the following.
    > <font face="Arial" size=2>
    > <p>ADODB.Recordset</font> <font face="Arial" size=2>error

    '800a0bb9'</font>
    > <p>
    > <font face="Arial" size=2>Arguments are of the wrong type, are out of

    acceptable
    > range, or are in conflict with one another.</font>
    > <p>
    > <font face="Arial" size=2>/XMLTest/getData.asp</font><font face="Arial"

    size=2>,
    > line 150</font>
    > I haven't modified getdata.asp as you indicated to John G because I'm not
    > clear what line(s) should be modified where this code snippet should be

    inserted.
    > Any chance that you could provide a corrected version of getdata.asp?

    Thanks



  8. #8
    Russell Jones Guest

    Re: Build Centralized VB, XML Apps Error: Suggestions?

    Sorry, my preceding post was incorrect. The line you need to replace is:
    R.Save Response, adPersistXML, not R.Save, adPersistXML. Bad typing.

    "Russell Jones" <arj1@northstate.net> wrote in message
    news:3aa94425$1@news.devx.com...
    > Dave:
    >
    > To modify getdata.asp, remove or comment out the line that reads: R.save,
    > adPersistXML, and replace it with the modifications from my previous post,
    > which will make the page run properly on IIS 4.
    >
    > Thanks,
    > Russell
    >
    >
    >
    > "Dave Fitzgerald" <david.fitzgerald@inforonics.com> wrote in message
    > news:3aa91d0f@news.devx.com...
    > >
    > > Hi Russell;
    > > It looks like I'm running into a similar but slightly different problem

    > than
    > > what John G gets my debug is producing the following.
    > > <font face="Arial" size=2>
    > > <p>ADODB.Recordset</font> <font face="Arial" size=2>error

    > '800a0bb9'</font>
    > > <p>
    > > <font face="Arial" size=2>Arguments are of the wrong type, are out of

    > acceptable
    > > range, or are in conflict with one another.</font>
    > > <p>
    > > <font face="Arial" size=2>/XMLTest/getData.asp</font><font face="Arial"

    > size=2>,
    > > line 150</font>
    > > I haven't modified getdata.asp as you indicated to John G because I'm

    not
    > > clear what line(s) should be modified where this code snippet should be

    > inserted.
    > > Any chance that you could provide a corrected version of getdata.asp?

    > Thanks
    >
    >




  9. #9
    Dave Fitzgerald Guest

    Re: Build Centralized VB, XML Apps Error: Suggestions?


    Thanks; You final tweak works like a charm. I even can run it from a pokey
    56k modem with little lag time!!

    "Russell Jones" <arj1@northstate.net> wrote:
    >Sorry, my preceding post was incorrect. The line you need to replace is:
    >R.Save Response, adPersistXML, not R.Save, adPersistXML. Bad typing.
    >
    >"Russell Jones" <arj1@northstate.net> wrote in message
    >news:3aa94425$1@news.devx.com...
    >> Dave:
    >>
    >> To modify getdata.asp, remove or comment out the line that reads: R.save,
    >> adPersistXML, and replace it with the modifications from my previous post,
    >> which will make the page run properly on IIS 4.
    >>
    >> Thanks,
    >> Russell
    >>
    >>
    >>
    >> "Dave Fitzgerald" <david.fitzgerald@inforonics.com> wrote in message
    >> news:3aa91d0f@news.devx.com...
    >> >
    >> > Hi Russell;
    >> > It looks like I'm running into a similar but slightly different problem

    >> than
    >> > what John G gets my debug is producing the following.
    >> > <font face="Arial" size=2>
    >> > <p>ADODB.Recordset</font> <font face="Arial" size=2>error

    >> '800a0bb9'</font>
    >> > <p>
    >> > <font face="Arial" size=2>Arguments are of the wrong type, are out of

    >> acceptable
    >> > range, or are in conflict with one another.</font>
    >> > <p>
    >> > <font face="Arial" size=2>/XMLTest/getData.asp</font><font face="Arial"

    >> size=2>,
    >> > line 150</font>
    >> > I haven't modified getdata.asp as you indicated to John G because I'm

    >not
    >> > clear what line(s) should be modified where this code snippet should

    be
    >> inserted.
    >> > Any chance that you could provide a corrected version of getdata.asp?

    >> Thanks
    >>
    >>

    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center