Results 1 to 8 of 8

Thread: Type Mismatch

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 1999
    Location
    Oak Creek, WI, USA
    Posts
    92

    Post

    I am working with a newly converted to Access 2000 database. Now, no matter which table I try to open (OpenRecordSet) I get a run-time error '13' Type mismatch for no apparent reason. It worked before!

    Thanks,

    casox

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    Didya change your references to use the right version of DAO? or MDAC?

  3. #3
    Lively Member
    Join Date
    Jul 1999
    Posts
    78

    Post

    I know what this is caused by, but I don't know the solution, myself.

    Here's the code that will raise the error:

    Code:
    Public Sub CheckVers()
    Dim PatchVers As Recordset
    Dim CurrentVers As Recordset
    Dim db As Database
    
    Set db = CurrentDb
    Set PatchVers = db.OpenRecordset("tblVersionNumber")
    Set CurrentVers = db.OpenRecordset("tblCurrentVersion")
    Upon either of the Set commands w/OpenRecordset method the 2000 db will return a type mismatch.

    I've checked DAO 3.60 referencing, and still get the error.

  4. #4
    Lively Member
    Join Date
    Jul 1999
    Posts
    78

    Post NM I got it

    I found out the problem . . .
    I had ADO 2.1 checked also, and it was first on my references list.

  5. #5
    New Member
    Join Date
    Aug 2001
    Location
    Quebec - Canada
    Posts
    4

    Question

    Hello, I have the same problem as Casox. Where I'm trying to connect to a Access 2000 database with my OpenRecordset. I have the lastest server pack for VB and MDAC. I also have checked DAO 3.60 referencing and still got the error. JohnAtWork said: "I had ADO 2.1 checked also, and it was first on my references list." but I can't find it in the list.

    If anyone can help me, I would be grateful.

    Thanks,

    Husky

  6. #6
    New Member
    Join Date
    Aug 2001
    Location
    Quebec - Canada
    Posts
    4
    I found the problem. You have to clear the reference to Microsoft ActiveX Data Objects.

    Thanks,

    Husky

  7. #7
    Junior Member JohannS's Avatar
    Join Date
    Aug 2001
    Location
    Pretoria, South Africa
    Posts
    21

    ActiveX Causing Problem?

    I needed the ActiveX components, but after removing the reference, and putting it back again, it worked fine.

    No more Type Mismatch.

    Strange thing though. Using a data control to connect to the db worked fine, only now when I used code only, did the error come up.

    What gives?

    Anyhow, thanks for the solution.
    It was an electrical problem sir, a conrod went through the block, and knocked the distributer off.

  8. #8
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    To avoid confusion, if you are using both ADO and DAO, use prefixes ADODB and DAO before the object types, for e.g. ADODB.Recordset and DAO.Recordset. This will clarify the code and also avoid such errors.

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

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