By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,224 Members | 1,143 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,224 IT Pros & Developers. It's quick & easy.

MSAccess determine if running unattended / batch

P: 1
We have a W2K / Access2K environment where recent maintenance has prevented the /X commandline switch from starting macro's.

We have several "batch" processes that run at night using the task scheduler and are started via simple macro's to run the code.

Is there a way I can determine if I am running "disconnected" so I can use an autoexec macro to determine if I shoud be doing "batch" things or open as usual for a user?

Or, is there a reg hack to allow command line /x macros to run?

TIA
Sep 13 '07 #1
Share this Question
Share on Google+
2 Replies


Scott Price
Expert 100+
P: 1,384
We have a W2K / Access2K environment where recent maintenance has prevented the /X commandline switch from starting macro's.

We have several "batch" processes that run at night using the task scheduler and are started via simple macro's to run the code.

Is there a way I can determine if I am running "disconnected" so I can use an autoexec macro to determine if I shoud be doing "batch" things or open as usual for a user?

Or, is there a reg hack to allow command line /x macros to run?

TIA
Have a look at this tutorial on how to check if any users are connected to the database...

http://www.thescripts.com/forum/thread684989.html

Regards,
Scott
Sep 14 '07 #2

ADezii
Expert 5K+
P: 8,669
We have a W2K / Access2K environment where recent maintenance has prevented the /X commandline switch from starting macro's.

We have several "batch" processes that run at night using the task scheduler and are started via simple macro's to run the code.

Is there a way I can determine if I am running "disconnected" so I can use an autoexec macro to determine if I shoud be doing "batch" things or open as usual for a user?

Or, is there a reg hack to allow command line /x macros to run?

TIA
Is there a way I can determine if I am running "disconnected"
I'm not sure if this will work in your specific case, but you can give it a try.
Expand|Select|Wrap|Line Numbers
  1. 'First, set a Reference to the Microsoft ActiveX Data Objects X.X Library
  2. Dim intState As Integer
  3. Dim cnn As ADODB.Connection
  4.  
  5. Set cnn = CurrentProject.Connection
  6.  
  7. intState = cnn.State
  8.  
  9. Select Case intState
  10.   Case adStateClosed
  11.     MsgBox "Connection Closed"
  12.   Case adStateOpen
  13.     MsgBox "Connection Open"
  14. End Select
Sep 17 '07 #3

Post your reply

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