Do you have experience with database programming with other languages and or know SQL?
Otherwise, this may be a little too advanced to start learning Cloverleaf/Tcl programming with.
The basics though are:
1. Create the ODBC configuration using the Windows ODBC Administration tool.
2. In your Tcl code, request the tclodbc package using ‘package require tclodbc’.
3. Open a connection to the database using ‘database connect db $DSN $database $user $password’. Note the third value (db) is a variable name which acts as a pointer to the database instance.
4. Create your SQL statement using parsed data or whatever. i.e. ‘set sql “SELECT ClientLabCode FROM LabCodes WHERE Vendor=’$vendor’ AND LabCode=’$labcode'”‘.
5. Execute the sql using the database instance. ‘set clientLabCode [db $sql]’.
6. Close the database instance. ‘db disconnect’.
That’s the basics. Depending on what you want to accomplish there may be more necessary.
Jonathan