Results 1 to 2 of 2

Thread: Problem with web service

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Posts
    96

    Problem with web service

    Hi Guys,

    I really appreciate you, if anyone could help me out of this.


    My problem is,

    I am developing a visual basic application, there

    I am trying to get data from sql server database through web services.

    So what I have done sofar is,

    I created a ASP file there I wrote the query to take certain numer of strories....

    i.e

    *********************************************
    <%
    dim strStoryid
    dim strTitle

    sSQL = "select top 5 * from LITERATURE order by
    Cre_Date desc"

    set rs = cn.Execute(sSQL)

    rs.save response, 1

    Cn.close
    Set cn = nothing
    set rs = nothing

    %>

    *********************************************************


    then in my visual basic application I have programmed something like this................

    Dim oXML As MSXML2.XMLHTTP30
    Dim llngPicHeight As Long

    Set oXML = New MSXML2.XMLHTTP30
    With oXML
    .Open "POST", "http://www.mywebsite.com/test/create_text.asp", False
    .setRequestHeader "text", "application/x-www-form-urlencoded"
    .send
    '.sXMLReturned = .responseXML.xml
    End With




    Set rs = New ADODB.Recordset

    Set oStream = New ADODB.Stream
    With oStream
    .Open
    '.WriteText sXMLReturned
    .Position = 0

    rs.Open oStream

    .Close
    End With
    Set oStream = Nothing

    Do While Not rs.EOF

    mstrMyTitle = rs("Title")
    mintMyStoryId = rs("Story_id")

    rs.MoveNext
    Loop


    The result*********************

    I am getting nothing but the error like "the stream is empty"

    I do not know how to correct this, if anyone understand me very well, please help me.

    Smily

  2. #2
    Fanatic Member Patoooey's Avatar
    Join Date
    Aug 2001
    Location
    New Jersey, USA
    Posts
    774
    Well....to start with, your code has nothing to do with ASP.NET. Your simply trying to return data thru a plain ASP page.

    The few times I've done this, I just looped and put all the data from the RS into a delimited string and Response.Write it back. Then grabbed it with INET and parsed it on the client side. Works fine for small datasets.

    I've never seen that you could stream an RS like that. Be real nice if you could.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width