473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

MS Access - open objects problem

Hi All
Question re MS Access 2002 for Win XP
new to this forum but have been following as a 'viewer' for some occasional help
now have one I cant find any answers to

I want to be able to identify/find any open or active queries, OR alternately tell if a particular table is 'in use' or locked in any way before trying to do a remotely controlled 'rename'

I have tried everything I can see with MsysObjects, MsysQueries, etc but can only get lists of ALL tables or ALL Queries etc - can not see any way to filter it down to open or active or locked
Mar 21 '08 #1
2 1486
I hope this helps.


Expand|Select|Wrap|Line Numbers
  1. Function LoadedTablesQueries(TableQueryName As String)
  2.     Dim obj As AccessObject, dbs As Object
  3.     Set dbs = Application.CurrentData
  4.  
  5.     ' Set two loops, one for Tables and one for Queries
  6.  
  7.     For Each obj In dbs.AllTables
  8.         If obj.IsLoaded = True Then
  9.         If obj.Name = TableQueryName Then LoadedTablesQueries = True
  10.         Else
  11.         LoadedTablesQueries = False
  12.         End If
  13.     Next obj
  14.  
  15.  
  16.     For Each obj In dbs.AllQueries
  17.         If obj.IsLoaded = True Then
  18.         If obj.Name = TableQueryName Then
  19.         LoadedTablesQueries = True
  20.         Else
  21.         LoadedTablesQueries = False
  22.         End If
  23.     Next obj
  24.  
  25.  
  26.  
  27.  
  28. End Function
Mar 21 '08 #2
I hope this helps.

Yep - you got it in one - that's perfect

I dont know much about VB so the discovery of some of those collections and properties is really exciting

I can put in some detail checking and force a close on something that might cause me some grief using DoCmd.Close

Thanks for your time and especially for the code

David
Mar 22 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
16
by: Rob Geraghty | last post by:
I've just spent some time looking through FAQ sites and searching the google archives of this newsgroup, but I still haven't been able to find a clear explanation of an issue with multi-user...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
9
by: Tony Lee | last post by:
Some time a ago, on this newsgroup the following comments were made in recommending good references for Access (2003) >I used to recommend Dr. Rick Dobson's, "Programming Access <version>" for...
4
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The...
39
by: Marcin Zmyslowski | last post by:
Hello all! I have the following problem with MS Access 2003 permissions. I have two users. One is admin and the second one is user who has full permissions to enter modify and read data. I...
17
by: rdemyan via AccessMonster.com | last post by:
With A2003, I'm having trouble accessing files in a folder on another computer where back-end files, update files, etc are located. Here's the scenario: 1) Computer #1 - A2003 2) Computer #2 -...
2
by: Frav | last post by:
The Reps team have been experiencing that Access 2002 unexpectedly quits while working and also lots of Corruption Failures and "Record lock can not update" messages since the upgrade from...
13
by: Owen Jenkins | last post by:
Following on from an earlier post... I can reliably corrupt a record by doing the following ... Open two separate but identical front ends on one PC each linking to the same back end. Edit a...
2
nico5038
by: nico5038 | last post by:
Access 2007 Linkedtable manager refuses to relink tables having a field with the "Attachment" datatype. Problem: When placing a split database in another folder, the Linked table manager should...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.