HELP - Problem getting Tony Toews's Performance Tip to resolve LDB locking problem to work.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • oscar

    HELP - Problem getting Tony Toews's Performance Tip to resolve LDB locking problem to work.

    I have read Tony Toews's web site from which I have deduced I have an
    LDB locking problem.

    I have tried to follow his solution as follows:

    1. I have created a dummy table in the back-end app. The Table is
    called "Dummy" and contains no data and only one field - a replication
    ID.

    2. I have linked to this table from the front-end app.

    3. I have created a blank form called "Dummy Form", the record source
    for which is "Dummy".

    4. In the module for this form, the following code appears

    Public rsAlwaysOpen As Recordset


    Private Sub Form_Close()
    rsAlwaysOpen.Cl ose
    Set rsAlwaysOpen = Nothing
    End Sub

    Private Sub Form_Open(Cance l As Integer)
    Set rsAlwaysOpen = CurrentDb.OpenR ecordset("Dummy ")
    End Sub

    5. Private Sub Form_Close() is attached to the On Close event
    6. Private Sub Form_Open(Cance l as Integer) is attached to the On
    Open event

    However, when I try to open the form I receive the following error
    message:

    "Run time error 13: Type mis-match"

    When I then press debug the line "Set rsAlwaysOpen =
    CurrentDb.OpenR ecordset("Dummy ")" is highlighted in yellow.

    I promise I have tried reading through the help pages but for the life
    of me do not understand why I would be getting a type mismatch - a
    table is a recordset isn't it?

    Any help gratefully received.

    Regards

    Oisin
  • Albert D. Kallal

    #2
    Re: HELP - Problem getting Tony Toews's Performance Tip to resolve LDB locking problem to work.

    Does all of your other dao code work?

    does the code compile?

    Try:

    Public rsAlwaysOpen As DAO.Recordset

    Make sure you have the

    Microsoft DAO 3.6 Object Library"

    Checked in your references

    Also, you could just bind the form to the table, and thus not even have to
    open the reocrdset.

    --
    Albert D. Kallal (MVP)
    Edmonton, Alberta Canada
    kallal@msn.com



    Comment

    • oscar

      #3
      Re: HELP - Problem getting Tony Toews's Performance Tip to resolve LDB locking problem to work.

      "Albert D. Kallal" <kallal@msn.com > wrote in message news:<pF27b.114 782$la.2564845@ news1.calgary.s haw.ca>...[color=blue]
      > Does all of your other dao code work?
      >
      > does the code compile?
      >
      > Try:
      >
      > Public rsAlwaysOpen As DAO.Recordset
      >
      > Make sure you have the
      >
      > Microsoft DAO 3.6 Object Library"
      >
      > Checked in your references
      >
      > Also, you could just bind the form to the table, and thus not even have to
      > open the reocrdset.[/color]

      The amended declaration and checking the reference as suggested - many thanks.

      Oisin

      Comment

      Working...