Loading XML strin

I have a SQL Select statment that returns XML. When I execute the statement from my vb.Net function and load the XML to a string it works fine. When I try to do the same thing in a vb6 function the XML come back messed up? Any ideas.
'Sample SQL statement form stored procedure get_data
SELECT * FROM MyData as XMLResults FOR XML AUTO, ELEMENTS 
 
 
'VB.Net
 
Public Shared Function GetSalesCustomerPricing(ByVal Acct As Integer) As String
 
    Dim oDs As DataSet
    Dim oCn As New SqlConnection(HttpContext.Current.Session("SQLConStr"))
    Dim oCmd As New SqlDataAdapter("get_data", oCn)
 
    oCmd.SelectCommand.CommandTimeout = 0
    oCmd.SelectCommand.CommandType = CommandType.StoredProcedure
 
    oCmd.SelectCommand.Parameters.Add(New SqlParameter("@Acct", SqlDbType.Int))
    oCmd.SelectCommand.Parameters("@Acct").Value = Acct
 
    oDs = New DataSet
    oCmd.Fill(oDs, "Results")
    oCn.Close()
 
    Dim strXML As String = ""
    Dim dtRow As DataRow
    Dim oTable As DataTable
    oTable = oDs.Tables("Results")
    For Each dtRow In oTable.Rows
        strXML = strXML & dtRow(0).ToString
    Next
 
    'Return XML string
    Return "<Results>" & strXML & "</Results>"
 
End Function
 
'Returned from vb.Net function
<FreightDefaults><DftTariffYear>0</DftTariffYear><DftPgPgm></DftPgPgm><DftWaPgm>276</DftWaPgm><DftClassDesc></DftClassDesc><AbsoluteMinimum>0.0000</AbsoluteMinimum><NonClassDisc>0.0000</NonClassDisc><ClassDisc>58.0000</ClassDisc><CalifDisc>50.0000</CalifDisc></FreightDefaults>
 
 
 
'VB6
Private Function getData(lngAcct as long) as string
 
    Dim strXML As String
    Dim strSQL As String
    
    Dim oRs As Object
    Set oRs = CreateObject("ADODB.Recordset")
   
    Screen.MousePointer = vbHourglass
    On Error GoTo Failed
    Err.Clear
    
    strSQL = "get_data "
    strSQL = strSQL & "@Acct = " & mlngAcct
    oRs.Open strSQL, moConnection.Connection
 
    Do Until oRs Is Nothing
        Do Until oRs.EOF
            strXML = strXML & CStr(oRs.Fields(0))
            oRs.MoveNext
        Loop
        Set oRs = oRs.NextRecordset
    Loop
 
    Set oRs = Nothing	
    getData = strXML
	
    Screen.MousePointer = vbDefault
    Exit Function
Failed:
    Screen.MousePointer = vbDefault
    MsgBox "getData() failed. Error is: " & Trim$(Err.Description), vbCritical, "Critical Message"
End Function
 
'Returned from vb6 function
?DftTariffYear?DftPgPgm?DftWaPgm?DftClassDesc?AbsoluteMinimum?NonClassDisc?ClassDisc?CalifDisc?FreightDefaults?L??  ???? ?A??? ??a???  ???E   ?a??    ???E ???c??  ???D?CustFreightId?ProgramType?ProgramDesc?BiDirect?StartDate?StopDate?AbsoluteMinimum?MaxDiscount?MaxPalletWeight?CustFreightId?ZoneId?CustFreightId?ZoneId?CustFreightId?LowValue?HighValue?UnitCost?CustFreightId?LowValue?HighValue?UnitCost?Tariffs?Tariff?OriginZone?DestZone?WeightBreak?QtyBreak?L??? ^????????????????????? ???? ??????? 
??????E ????    ?B ????3??? ?????3??? ?????3??c ?E ??????3??d ????  ?N??? ????? ?E ??????3??? ????  ?N??? ????? ?E ??????3??? ??'??  ?N??? ??'??? ?E ??????3??? ??Ã??  ???D?LaneDiscountId?BiDirect?StartDate?StopDate?Discount?LaneDiscountId?ZoneId?LaneDiscountId?ZoneId?LaneDiscounts?LaneDiscount?OriginZone?DestZone?D?ClassDesc?RatedAsClassDesc?ClassExceptions?ClassException?D?ChargeDesc?Required?ManualEntry?Per100?Percentage?FlatAmount?MinCharge?MaxCharge?Charges?Charge?L??? ???????^?`????????  ? ?E   ??    ?E   ??    N??? ???????^?????? ??E   ??    ?E   ??    ?E   ??

Open in new window

LVL 8
Bob HoffmanDeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Anthony PerkinsCommented:
Xml is returned as a Stream and not as a recordset.  In other words, you need to use the ADO Stream object instead of the Recordset object.
0
Bob HoffmanDeveloperAuthor Commented:
I wound up write a .Net dll that I use in my vb6 program to return the XML
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Anthony PerkinsCommented:
Sounds good.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.