Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Apr 2002
    Location
    Nottingham, Nottinghamshire, England
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Count the no. of a given db opened by a user (97 sr2 / xp)

    We're upgrading from access 97 to access xp, not too many problems so far, but we have one system that makes an api call to find out how many instances of the database that particular user has open and shut down if the count is greater than 1. It uses the following
    Private Declare Function GetCurrentVbaProject Lib "vba332.dll" Alias "EbGetExecutingProj" (hProject As Long) As Long
    (hands up, I have no idea about api calls). When this is called Access pops up a message missing file vba332.dll, so I went of and did a search, found the file and put the full path in. Trouble is everytime I run the code I get a "fatal error can I phone home to report" message and access shuts down.

    Any suggestions?

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Count the no. of a given db opened by a user (97 sr2 / xp)

    2000 and XP don't implement vba332.dll, which was used in Access 97. Starting with Office 2000, Access uses the Microsoft Visual Basic Editor (vbe6.dll) instead of the functionality in the Visual Basic for Applications library. Since you're trying to mix versions of VBA (A97 was VBA5 and A2k and AXP are VBA6), I'm not surprised that it's self-destructing. With Access XP, trying to open the same database twice on a machine will give you an error if you open Access and try to open the database. If you double click the database in the explorer window, it simply ignores you.
    Charlotte

  3. #3
    Star Lounger
    Join Date
    Apr 2002
    Location
    Nottingham, Nottinghamshire, England
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Count the no. of a given db opened by a user (97 sr2 / xp)

    Cheers Charlotte, you live and learn;-)
    You're right and double clicking the database in the explorer window does exactly what i want it to do, unfortunately they launch the database from a batch file which opens another instance:-(

Posting Permissions

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