Statit Support Articles
Administration
Frequently Asked Questions
How-to
ODBC
Sample Code
 
Quality Practice Tips

Subscribe to Statit Bulletin, our quarterly SPC/Quality Resource e-newsletter

Your Name:
E-mail:
Company:
Industry: Healthcare
Manufacturing
 

Statit & ODBC: MS Access


Abstract: General information about the ODBC mechanism used by Statit 5.x to read Microsoft Access data

Products: Statit e-QC, Statit e-Server, Statit Custom QC, Statit Express QC

Microsoft Access data may be read into Statit through ODBC. Use the "Connect to Data Source" to set up your connection to Access, and then use the Query Tool or SQL to read the data.

If you were entering the commands into the Statit command window, they would look like this:


dbconnect /DSN="StatitDemoDB"
dbsql SELECT Operation, Machine, Parameter, Measurement from Measurement_Data


Note that column names with blanks are surrounded by grave accents ('). The DSN is the Data Source Name.

When you put these commands into a macro, youcan use the BeginSQL-EndSQL block. Your macro would look like this:


dbconnect /DSN="StatitDemoDB"

beginsql
SELECT
   Measurement_data.Operation,
   Measurement_data.Machine,
   Measurement_data.Parameter,
   Measurement_data.Measurement
FROM
   Measurement_data
WHERE
   Measurement_data.Part_name = 'Gold 45'
endsql
dbdisconnect

The above commands may be used in a Statit macro or in a procedure. However, in a procedure we recommend you use the following functions and test for the return value.


$rs = dbconnect("StatitDemoDB","","","","",0)
...

beginsql

  SELECT
     Measurement_data.Operation,
     Measurement_data.Machine,
     Measurement_data.Parameter,
     Measurement_data.Measurement
  FROM
      Measurement_data
  WHERE
     Measurement_data.Part_name = 'Gold 45'

endsql

dbdisconnect
if $db_numrecs =0 then
   return
endif
...

If you would like additional information, please call our Support staff at (541) 752-4100 or send email to .