I use the following to check if the connection is active, and if it
already is, then it exits out of the log on routine and uses the active
session. I assign different session names to each script so multiple
scripts can run on the same PC at the same time.
MeditechSessionName = "NAME OF SCRIPT"
If Not Active(MeditechSessionName) Then
Connect "C:\Program Files\Meditech 3.24\t.exe", stMeditech,
MeditechSessionName
Else: Exit Sub
End If
Joel C Meyerett, CPC, CPC-H
Children's Mercy Hospitals and Clinics
Sr Programming & Database Specialist
Patient Financial Services
Ph: (816) 855-1868
Fx: (816) 234-3104
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED]
Sent: Sunday, October 05, 2008 6:17 AM
To: [email protected]
Subject: [talkbws] How to check if Meditech is running before you
connect ...
Problem: A script that contains a connection to Meditech errors out if
Meditech has been previously started by BWS. The error message is
Run-time error '-2147463162'
Method '~' of object '~' failed.
This error message gives no clue to the user as to the cause of the
problem or what to do to get it resolved.
Does anyone know of a way to check if Meditech is running before the
'CONNECT' command is issued, thus fixing the cause of the problem?
Failing that, does anyone know how to more gracefully fail, i.e., let
the user know that they need to exit Meditech before re-running the
script?
---
To post a message to this list, send mail to: [email protected]
You are currently subscribed as: [EMAIL PROTECTED]
Unsubscribe in the customer center on our website:
http://www.bostonworkstation.com/customer_center/virtual_user_group_talk.aspx