Results 1 to 9 of 9

Thread: 97 works, Type mismatch in 2000

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    Washington DC
    Posts
    330

    Arrow 97 works, Type mismatch in 2000

    Help!!, I am receiving a type mismatch error in access 2000. below is the code I always have utilized in access 97 with out issue. now in 2000 when it gets to the line Set rst = dbs.OpenRecordset.... I am receiving a Run time error 13, type mismatch. I donot understand why.

    Can anyone help?

    Sub LoadHolidays()
    ' This routine should be loaded at startup

    Dim x As Integer
    Dim dbs As Database
    Dim rst As Recordset

    Set dbs = CurrentDb

    Set rst = dbs.OpenRecordset("select * from holidays where holidays;", dbOpenDynaset, dbSeeChanges)

    rst.MoveLast

    arrSize = rst.RecordCount
    ReDim arrHolidays(arrSize) As Date

    rst.MoveLast

    x = 0
    Do While Not rst.EOF
    arrHolidays(x) = rst.Fields("Holidays")
    rst.MoveNext
    x = x + 1
    Loop


    End Sub

  2. #2
    Frenzied Member PilgrimPete's Avatar
    Join Date
    Feb 2002
    Posts
    1,313
    You'll need to qualify all your recordsets:
    VB Code:
    1. Dim rst As DAO.Recordset
    ...or remove the reference to ADO in the project references (I think it's added by default in Access 2K).

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    What service pack level are you runnning?

    You should be at SP5.

  4. #4
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    i don't know if you shrunk down ur code for the post.. but that SQL statement doesn not look right... the where clause...

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    Washington DC
    Posts
    330

    thanks

    That ADO vers ADODB worked.

  6. #6
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    ummm aren't you using DAO?? not ADO?

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    Washington DC
    Posts
    330
    yeah, I jsut cant make my fingers do what my mind is saying

  8. #8
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    Originally posted by kleinma
    ummm aren't you using DAO?? not ADO?
    confusing much?!!?!?
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  9. #9
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    i am surprised that there isn't ODA, AOD, or OAD with .NET or something

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