CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2001
    Posts
    17

    Recordset Object

    I am using the Recordset object in Access 2000, but it seems that there are a few different definitions of it, and so I get a "type mismatch" error on the following code:

    Dim db as Database
    Dim rc as Recordset
    set db=CurrentDB
    set rc=db.OpenRecordset("mytable")




    I think it's because of the References table I am using ("Visual Basic for Applications", "Microsoft Access 9.0 Object Library" and more).
    How do I force the "Dim rc as Recordset" statement to define my variable as the same Recordset that Database.OpenRecordset is returning ?

    Thanks,
    Yaron.



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

    Re: Recordset Object

    That might happen if you use ADO recordset and referencing to the DAO object Database. Make shure that either you are using ADO or DAO. In case you are using both of them you have to use prefix like

    Dim db as DAO.Database
    or
    Dim rc as ADODB.Recordset

    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