CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2001
    Location
    Kerala, India
    Posts
    4

    ADO Recordset as Procedure parameter? (Visual Basic 6)

    Hello,

    I am a Visual Basic programmer. While working with master-detail forms I need to use SQL Server 2000 Procedure for child recordset to improving the performace. Is there any option for passing a ADO recordset as parameter.

    Thanks in advance
    Kiran


    Aum Namah Shivaya

  2. #2
    Join Date
    Feb 2000
    Posts
    440

    Re: ADO Recordset as Procedure parameter? (Visual Basic 6)

    Yes there is:

    Declare a recordset and call the function



    private Sub Form_Load()
    Dim rstTemp as new ADODB.Recordset
    rstTemp.CursorLocation = adUseServer
    rstTemp.CursorType = adOpenForwardOnly
    rstTemp.LockType = adLockReadOnly

    UseRecordset(rstTemp)

    rstTemp.Close
    set rstTemp = nothing
    End Sub

    public Function UseRecordset(Recordset as Object)

    'Check if this is Recordset
    If Not TypeOf Recordset is ADODB.Recordset then Exit Function

    'Do Sth with Recordset
    Recordset.AddNew
    '
    '
    '
    Recordset.Update

    End Function







    Valery Iskarov Nikolov
    http://listen.to/quark

  3. #3
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: ADO Recordset as Procedure parameter? (Visual Basic 6)

    You also can get recordset as returned value of a function

    Private Function myFunc(...any parameters to pass...) As ADODB.Recordset

    ...process stuff

    Set myFunc = rsSomeRecordsetCreated
    End Function


    call it as:

    Dim rs As ADODB.Recordset
    Set rs = myFunc(...)



    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

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

Featured