Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    May 2003
    Location
    Whittier, California
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Further Problems with Newly Split Database (2000)

    I recently split a database into frontend & backend. I have a sub in which I redimension several variables based on the number of records in a table. Now that the table is in the backend database the RecordCount always reads as 1. I tried changing:

    Set dbs = CurrentDb

    to the backend database, as so:

    Set dbs = "ScuhsnetclinicalinternshipCID_be.mdb"

    but I just get a type mismatch error. How do I fix this problem?

    Kevin

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Further Problems with Newly Split Database (2000)

    You can't assign a string to a database variable. Use

    Set dbs = OpenDatabase("ScuhsnetclinicalinternshipCID_be.mdb ")

    But if you create links to tables in the backend , you don't need this.

  3. #3
    Lounger
    Join Date
    May 2003
    Location
    Whittier, California
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Further Problems with Newly Split Database (2000)

    But I do have a link in the frontend to that table. If I didn't, wouldn't I get an error when I use the command:

    Set rst = dbs.OpenRecordset("tblName")

    Instead, it accepts this statement, but then I have the following:

    intRowCnt = rst.RecordCount

    and it keeps reading 1, regardless of the number of records in the table. This sub worked fine before I split the database. Any idea why I'm having this problem?

    Kevin

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Further Problems with Newly Split Database (2000)

    Access doesn't read the entire recordset when you open it, for performance reasons. To get a dependable recordcount, perform an rst.MoveLast before retrieving the RecordCount. This forces Access to read the entire recordset.

  5. #5
    Lounger
    Join Date
    May 2003
    Location
    Whittier, California
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Further Problems with Newly Split Database (2000)

    Thanks a lot, that did the trick.

    Kevin <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>

Posting Permissions

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