Help for Setting up and accessing Remote Data Bases that contain the employee names

Introduction

The EsdTest program typically uses the EsdTest data base file (Names.txt file) to store employee names, badge numbers. Id number, and other information.  However a customer's existing remote data base can also be used.  Typical data bases include Oracle, SQL2000, Access 2000, and most other SQL type data base servers..  The EsdTest program can be set up to do one of the following:
1. Find an employee in the remote data base if the employee can not be found in the EsdTest Names.txt file data base, and add that employee's information to the EsdTest data base.
2. Only use the remote data base and never use the EsdTest Names.txt file data base.  Note that this method will prohibit using most of the EsdTest report features, and will only work as long as the network and remote data base server are functioning.  
3. Use the remote data base, but keep a local copy of it to use if the network or server stops functioning.  Note that this method will prohibit using the EsdTest sick/vacation report features.
4. Only use the EsdTest data base file (Names.txt file).


The operating characteristics are further described here.

Method 1 - Uses the remote data base only if the employee can not be found in the EsdTest Names.txt file data base, and adds that employee's information to the EsdTest data base.  For example, if John Smith is a new employee and has not been entered into the EsdTest data base, then without this feature he would not be recognized.  What this feature does is:

Testing sequence
1. When a person swipes his badge, look up the badge number in the EsdTest Names.txt data base and retrieve the last name, first name, and id#
2. If the person is not found in the EsdTest data base, then look up the person's badge number in the Remote data base.  If the person is found there, then get the //////////////person's ID number from the remote data base, and search the EsdTest data base for the person's id#
a. if it already exists then update that person's badge number in the EsdTest data base
b. else add the person to the EsdTest data base
3. If the employee is not found in the remote data base either, and if the Unknown employee setup window is configured to accept unknown employees (see adding unknown employees in the main help file), then the employee may key in his name and be added to the Esdtest data base.
4. Otherwise the employee will be rejected and not allowed to test.  
5. If recognized, the employee may then proceed with the test, and the test data is stored in the EsdTest log.txt data base, and/or a remote log data base (see Remote test data base help file)
6. The Esdtest data base can be later exported back to the remote data base if desired



Method 2 - Only use the remote data base and never use the EsdTest Names.txt file data base.  Note that this method will prohibit using most of the EsdTest report features, and will only function as long as the network and remote data base server are functioning.  Editing the employee information from the EsdTest program can only be done by another copy of the EsdTest program running in Method 1, 3, or 4 and importing the entire remote data base into the EsdTest Names.txt file, editing it, then exporting back to the remote data baser.  What this feature does is:

Testing sequence
1. When a person swipes his badge, look up the badge number in the Remote data base and retrieve the last name, first name, and id#
2. If the person is not found in the EsdTest data base, then the employee will be rejected and not allowed to test.  
3. If recognized, the employee may then proceed with the test, and the test data is stored in the EsdTest log.txt data base, and/or a remote log data base (see Remote test data base help file)


Method 3 - Use the remote data base, but keep a local copy of it to use if the network or server stops functioning.  Note that this method will prohibit using the EsdTest sick/vacation report features.  What this feature does is:

Testing sequence
1. On program boot, copy the entire remote data base to the EsdTest Names.txt file data base.  Note that this overwrites all the previous data and clears all sick and vacation data.
2. When a person swipes his badge, look up the badge number in the remote data base.  If the person is not found in the remote data base, then the employee will be rejected and not allowed to test.
3. If the person is found in the remote data base, then update the EsdTest data base if that person is not already in there.
4. If the remote data base or network is unavailable, then look up the employee in the EsdTest Names.txt file data base.  If the person is not found in the remote data base, then the employee will be rejected and not allowed to test.
5. If recognized, the employee may then proceed with the test, and the test data is stored in the EsdTest log.txt data base, and/or a remote log data base (see Remote test data base help file)




REMOTE DATA BASE CREATION

Create a view with a name like ESD_EMP_BADGE_VW to the company data base with the following fields:
LAST_NAME    (will be holding data like - Smith)
FIRST_NAME   (will be holding data like - Fred)
BADGE        (will be holding data like - 3852)
DEPT         (will be holding data like - CIA) 
EMPID        (will be holding data like - 12345)
WRIST_USED   (will be holding data like - 0 or 1) this field is not required
FOOT_USED    (will be holding data like - 0 or 1) this field is not required
CERTIFICATION_EXPIRATION_DATE (will be holding data like - 10/28/2006) this field is not required

It may be best to have all fields be text (char) fields, although the CERTIFICATION_EXPIRATION_DATE field can be a date field.

For Oracle create an ODBC driver instance and a DSN name such as ESD.

If writing names or certification dates to the remote database will never be used, then the remote data base can be set up as read only.

EsdTest SETUP

Click Setup, Remote data base of names to open the setup window and enter the following items:

Connect String: Enter the data base connection string which for Oracle might look something like:  
   Server=WPRPROD;DSN=ESD;UID=wprread;PWD=wprread 
And for SQL2000 might look something like:
   UID=;PWD=;Database=ESD_EMP_BADGE;Server=MYSERVER;Driver={SQL Server};DSN=;
And for Access .mdb might look something like:
   Driver={Microsoft Access Driver (*.mdb)};Dbq=c:\EsdTest\EsdTest.mdb;Uid=Admin;Pwd=

SQL read prefix: Select the fields from the view by entering something like:
   SELECT * TRANSFER.FROM ESD_EMP_BADGE_VW           (if using Oracle)
Or SELECT * FROM ESD_EMP_BADGE_VW                    (if using SQL2000)
Or SELECT * FROM ESD_EMP_BADGE               (if using an Access table)

If appending names to the data base (by pressing Export names button) then 
SQL write prefix: Insert names by entering something like:
   INSERT INTO ESD_EMP_BADGE_VW           (if using Oracle)
Or INSERT INTO ESD_EMP_BADGE_VW           (if using SQL2000)
Or INSERT INTO ESD_EMP_BADGE              (if using an Access table)

If replacing names in the data base (by pressing the Export names button) then 
SQL delete prefix: Replace (delete old) names by entering something like:
   DELETE FROM ESD_EMP_BADGE_VW           (if using Oracle)
Or DELETE FROM ESD_EMP_BADGE_VW           (if using SQL2000)
Or DELETE FROM ESD_EMP_BADGE              (if using an Access table)


If writing names or certification dates to the remote database will be used, then the remote data base must not be set up as read only.

Last name field: Enter the name of the field that contains the last name which should look something like:
   LAST_NAME

First name field: Enter the name of the field that contains the first name which should look something like:
   FIRST_NAME

Badge name field: Enter the name of the field that contains the badge number string which should look something like:
   BADGE

Group field name: Enter the name of the field that contains the Group string which should look something like:
   DEPT

Id field name:  Enter the name of the field that contains the Id string which should look something like:
   EMPID

Wrist used field: (optional) Enter the name of the field that contains the Wrist used value (should be 1 if using wrist straps and 0 if not required to use wrist straps)which should look something like:
   WRIST_USED

Foot used field: (optional) Enter the name of the field that contains the Foot used value (should be 1 if using foot straps and 0 if not required to use foot straps)which should look something like:
   FOOT_USED

Certification expiration date field: (optional) Enter the name of the field that contains the Certification expiration date which should look something like:
   CERTIFICATION_EXPIRATION_DATE


Method 1 Operation
Click the top radio button in the Setup Remote Data Base window
To add employees to the EsdTest Names.txt file data base:
If the setup boxes are not blank, and if an employee scans his badge and is not found in the local data base, the program will automatically search for unknown employees in the remote data base

To delete (scrub) employees who are no longer in the remote data base from the EsdTest data base, and update employees who's name, badge number, group, strap reguirement, or certification expiration date has changed (but who still has the same ID number, and still has either the same last name or the same badge number), either:
Manually click on Reports, "View or Print Update modify/remove employees using remote data base" report
Automatically - Enter the Update function in the AutoGenerate email task scheduler.  This should be done after running a GetNames to combine all the names from other test stations, and before a SendNames to send the combined names.txt data file back down to all the test stations.  Since this might take a while, it should probably be done during a period when other reports are not needed to be run.

Note that the Scrubbing will be aborted if more than 50% of the names in the EsdTest data base are not found in the remote data base, as a safety measure to prevent too many names from being scrubbed in case of a remote data base error. 
However, WHEN USING THE UPDATE/SCRUB FEATURE, KEEP GOOD BACKUPS OF THE NAMES.TXT DATA BASE just in case.  You can use the BackupNames function in AutoGenerate email, or click on Tools Backup names.
Scrubbing will not add employees from the remote data base to the EsdTest, it will only modify (update if already there), or delete.  This prevents the entire corporate employee listing from being added - employees will only be added as they test.

Method 2 Operation  (remote data base only)
Click the 2nd radio button in the Setup Remote Data Base window.  All employee editing features and most reports are disabled.

Method 3 Operation  (remote data base if available)
Click the 3rd radio button in the Setup Remote Data Base window.  If the employee information editor is used, it will only modify the Names.txt file, so the Names.txt file will need to be exported to the remote data base (see Tools menu)

Method 4 Operation  (never use the remote data base)
Click the 4th radio button in the Setup Remote Data Base window


An example Access 2000 data base (EsdTest.mdb) is included in the EsdTest directory.  The best way to get familiarized with this feature is to use this example.  You can open it with MS Access or other data base editing program to see what the table looks like, then close it.  Set up our Remote Data Base configuration window to use this data base (EsdTest.mdb) as instructed above.  Copy and paste the configuration parameters from this file into the set up window.  Setup the Employee Selection configuration window to use Keyboard and Identify employee by scanning name or badge#.  When the "Please type your badge#" window appears, type 12321.  This badge number is not currently in our example names.txt data base, so the remote data base feature will look for it in the EsdTest.mdb data base and add it to the Names.txt data base. 






