Knowing the status of the table

  • Thread starter Thread starter Aditya Sanghi
  • Start date Start date
A

Aditya Sanghi

Environment : MS Access , VC++ 6.0 , Windows NT , 2000.

Hi All,
Is there a way to find out if a particular table has been opened
by any recordset or not.

The scenario is that I have multiple objects of recordsets for a table,
these recordsets do read/write on the table , I need to know before
opening if the table has been opened by any other recordset or not.

Regards,
Aditya Sanghi
Director

ABO Software Private Limited
"EDISPHERE", XML/EDI Translation System
B102 Gulmohar Park New Delhi 110049
Tel: +91 11 2-6512822, 2-6968976 Fax: 2-6518873
website: www.abosoftware.com
 
Curious why you "need to know" if a table is open or not.
Access is managing this for you via the LDB file. There
are 3 levels of table locking (see Access Help) depending
on your business requirements.

Al Moroz
http://www.abacus-strategies.com

**NOTE: Do not respond to the email address, it's for
Newsgroups only
 
Can't help with C++, Aditya, but in VBA, I'd probably attempt to get an
exclusive lock on the table (open a recordset using pessimistic locking and
attempt to put it in edit mode) and trap the error that would be raised if
the lock could not be obtained.

There may be another alternative, but I haven't tried this - I *think* you
could walk the Recordsets collection of the Database object and examine the
Source property for the name of the table. (I'm thinking in DAO here, not
quite sure what the ADO equivalent, if any, would be.) Then again, I don't
suppose that would be reliable if recordsets might be opened using saved
queries - I believe the Source property would return the name of the saved
query, with no direct reference to the table.
 
Back
Top