In Tip #12, we showed how to display a Progress Meter within Access by using the SysCmd() Function. By using this same Function, with different Action Arguments, we will now demonstrate how you can return specific Access information as well as determining an Object's (Table, Form, Report, Macro, Module, etc) State. Instead of preceding the code display with an Overview, I decided to more fully comment the code, since for the most part it will be self explanatory. Sample output will then be shown to demonstrate the code's end result. - To Retrieve Access Specific Information:
- Debug.Print "1) The Main Access Directory is: " & SysCmd(acSysCmdAccessDir)
-
Debug.Print "2) The Access Version is: " & SysCmd(acSysCmdAccessVer)
-
Debug.Print "3) The Path to the Access Woekgroup File is: " & SysCmd(acSysCmdGetWorkgroupFile)
-
Debug.Print "4) The Name of the .ini File associated with Access is: " & SysCmd(acSysCmdIniFile)
-
Debug.Print "5) Is this Version of Access the Runtime Version?: " & IIf(SysCmd(acSysCmdRuntime), "Yes", "No")
-
Debug.Print "6) The /profile setting specified by the user when starting Microsoft Access from the command line: " & IIf(IsNull(SysCmd(acSysCmdProfile)), "None Specified", SysCmd(acSysCmdProfile))
OUTPUT - The Main Access Directory is: C:\Program Files\Microsoft Office\Office\
-
The Access Version is: 9.0
-
The Path to the Access Woekgroup File is: C:\PROGRA~1\MICROS~2\Office\SYSTEM.MDW
-
The Name of the .ini File associated with Access is: msacc30.ini
-
Is this Version of Access the Runtime Version?: No
-
The /profile setting specified by the user when starting Microsoft Access from the command line: None Specified
------------------------------------------ - To Determine the State of an Access Object:
- ObjectState = SysCmd(action[, objecttype][, objectname])
-
'objecttype can be 1 of the following:
-
'acTable, acQuery, acForm, acReport, acMacro,
-
'acModule, acDataAccessPage, acDefault,
-
'acDiagram, acServerView, acStoreProcedure
-
-
'An Object can be in one of four possible states or variations thereof:
-
'return Value of 0 = not open or non-existent
-
'acObjStateOpen = 1
-
'acObjStateDirty = 2 (Changed but not saved )
-
'return Value of 3 = Open and Dirty
-
'acObjStateNew = 4
-
'return Value of 5 = Open and New
-
'return Value of 7 = Open, Dirty, and New
-
-
Debug.Print "State of Form3: " & SysCmd(acSysCmdGetObjectState, acForm, "Form3")
-
Debug.Print "State of rptFinance: " & SysCmd(acSysCmdGetObjectState, acReport, "rptFinance")
-
Debug.Print "State of tblEmployee: " & SysCmd(acSysCmdGetObjectState, acTable, "tblEmployees")
-
Debug.Print "State of qryCustomers: " & SysCmd(acSysCmdGetObjectState, acQuery, "qryCustomers")
-
Debug.Print "State of mcrOpenDatabase: " & SysCmd(acSysCmdGetObjectState, acMacro, "mcrOpenDatabase")
-
Debug.Print "State of mdlUtilities: " & SysCmd(acSysCmdGetObjectState, acModule, "mdlUtilities")
- OUTPUT
- State of Form3: 1 (Open)
-
State of rptFinance: 0 (Not Open or Non-Existent)
-
State of tblEmployee: 5 (Open and New)
-
State of qryCustomers: 3 (Open and Dirty)
-
State of mcrOpenDatabase: 7 (Open, Dirty, and New)
-
State of mdlUtilities: 0] (Not Open or Non-Existent)
0 7255 Sign in to post your reply or Sign up for a free account.
Similar topics
by: Mahesh Hardikar |
last post by:
Hi ,
I have been trying to connect to access database from SQL Server 7.0.
This machine is having 7.0 as a default instance and 2000 as a named
instance.
Also the machine doesn't have access...
|
by: Ryan Muller |
last post by:
My company just upgraded from Access 97 to Access 2003 today and we are
having some issues in a database that generates a Word document from
information selected in a form.
Here is the code we...
|
by: Patrick |
last post by:
I have the following code, which regardless which works fine and logs to the
EventViewer regardless of whether
<processModel/> section of machine.config is set to username="SYSTEM" or
"machine"
...
|
by: SFX |
last post by:
If I have a session ID (string) can I somehow obtain the session object
associated to that ID (it exist of course) ?
I know this sounds wicked but I have a situation in which I have to make a...
|
by: Shawn |
last post by:
Hi.
In my application I store information about the user in the session object.
Since I'm storing sensitive information I encrypt it before storing and
decrypt it when I need to use it again. The...
|
by: Nick Gilbert |
last post by:
Hi,
Is it possible to access the Session of an arbitary user from an aspx page?
On an e-commerce site, I am notified of payment success via a callback
from the payment server to an ASPX page...
|
by: Rameel |
last post by:
Friends,
I'm probably being more critical with VB.Net Windows application.
I have Developed VisualStudio 20005 VB.Net Windows application
how willl i be able to save a specific record into my...
|
by: RSH |
last post by:
I have a situation where I have a page called "HiddenFrame.aspx" that
contains a public property exposing the value of a textbox called "TextBox1"
that is in a hiddenframe.
Loaded in the main...
|
by: Andy B |
last post by:
I have a class I am creating for data access. I need to access controls from
inside the class that are on a particular page. How do I do this? or is
creating an instance of the page class and using...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |