View Single Post
  #1 (permalink)  
Old May 23rd, 2006, 09:02 AM
dgulliver dgulliver is offline
Registered User
 
Join Date: May 2006
Location: London, , United Kingdom.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Creating/Populating Recordsets in ADO

Hi,

It's been awhile since I've used ADO in VB6 but I was wondering how you could create a recordset without being connected to a Database in ADO. Basically we use Client Access to connect to a Iseries server and once we have returned data via cobol routines I was to place the data into an ADO recordset.

I've done this using ADO.Net but cannot figure it out in ADO 2.x

Example in ADO.NET

        Dim dsDataSet As New DataSet()
        Dim dtResults As DataTable = dsDataSet.Tables.Add("Table")

        dtResults = New DataTable()

        dtResults.Columns.Add("swftid", System.Type.GetType("System.String")) 'Message Type
        dtResults.Columns.Add("medind", System.Type.GetType("System.String")) 'Medium
        dtResults.Columns.Add("trntyp", System.Type.GetType("System.String")) 'Transaction
        dtResults.Columns.Add("probco", System.Type.GetType("System.String")) 'Problem Code
        dtResults.Columns.Add("paytyp", System.Type.GetType("System.String")) 'Payment Type
        dtResults.Columns.Add("cpcode", System.Type.GetType("System.String")) 'Counterparty
        dtResults.Columns.Add("secode", System.Type.GetType("System.String")) 'Security
        dtResults.Columns.Add("thdval", System.Type.GetType("System.String")) 'Value Threshols

then query database using cobol and return in to DataSet

            For i = 0 To iNumberReturned - 1
                row = dtResults.NewRow()
                row.Item(0) = Trim(WSTPINEX.LsWstpinexSwftid(i)
                row.Item(1) = Trim(WSTPINEX.LsWstpinexMedind(i)
                row.Item(2) = Trim(WSTPINEX.LsWstpinexTrntyp(i)
                row.Item(3) = Trim(WSTPINEX.LsWstpinexProbcode(i)
                row.Item(4) = Trim(WSTPINEX.LsWstpinexPaytyp(i)
                row.Item(5) = Trim(WSTPINEX.LsWstpinexCpcode(i)
                row.Item(6) = Trim(WSTPINEX.LsWstpinexSeccode(i)

                iCounter = iCounter + 1
                dtResults.Rows.Add(row)
            Next i

Would it be possible to show me the alternative in ADO2.x or point me in the right direction please.

Regards
Darren

Reply With Quote