Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2004
    Posts
    145

    Unanswered: Recordset Type Mismatch

    I am passing a recordset as a parameter for a procedure and getting a type mismatch. Here is the just of the code:

    public sub main
    dim rst as new adodb.recordset


    call func1(rst)

    end sub
    -------------

    public sub func1(rst as adodb.recordset)

    call func2(rst)

    end sub

    public sub func2(rst as adodb.recordset)

    blah,blah,blah

    end sub

    ---- Done ----

    if I call 'func2' directly from 'main' it works fine, but if I call 'func2' from 'func1' I get a type mismatch on the recordsets. I've tried messing with byval and byref. I don't know what is up. TIA
    GG

  2. #2
    Join Date
    Apr 2003
    Posts
    280
    dim rst as new adodb.recordset

    change to:

    dim rst as adodb.recordset
    set rst = new adodb.recordset

    where is your variable to connect to the database?

  3. #3
    Join Date
    Jan 2004
    Posts
    145
    It still does not work. The recordset (rst) is opened in 'main' based on a query and then is passed to 'func1'.

  4. #4
    Join Date
    Jan 2004
    Posts
    145
    I think what was wrong is that I needed to use "Call" in front of func1.

  5. #5
    Join Date
    Jan 2004
    Posts
    145
    I showed that I used it above, but wasn't actually in the code.

Posting Permissions

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