DAQFactory supports logging of data directly into an ODBC compliant database. In addition to enterprise type databases, this can be used to log data directly into Access, Excel, FoxPro and other local databases. To use this method, you must create a blank database and a data source. The blank database can be exactly that, blank. There is no need to create any tables (or worksheets in Excel). The database must simply exist. DAQFactory will take care of adding tables to the database as needed. A data source is used by ODBC to tell DAQFactory what database to use and what database engine to use with it. The database engine essentially acts like a translator, allowing DAQFactory to communicate with any database you have an engine for. Windows typically installs with a database engine for Access, Excel, dBase, FoxPro, Paradox, Text files, and a few others.
Note: you must use a 32 bit ODBC driver with DAQFactory. As a 32 bit app, DAQFactory cannot connect to 64 bit ODBC drivers.
We'll assume you know how to create a blank database (if necessary), and quickly give you instruction on creating a data source. This is all done using Microsoft tools external to DAQFactory and the exact method may be different for your version of Windows.
1. Open up the Microsoft ODBC Administrator. Make sure it is the 32 bit version of the ODBC tool.
This will either be in your Administrative Tools folder in your Start Menu, in your Control Panel, or in your System or System32 directory (file name: ODBCAD32.exe). It may also be called Data Sources (ODBC).
2. Once loaded, click on the System DSN tab.
This looks just like the User DSN and File DSN tab. System DSN's are available to all users on your system. User DSN's are only available to the user that created them. Creating the Data Source is identical for both.
3. Click on the Add button. You will then be prompted for a driver. This is the desired engine driver. Click on Finish when you find the one you need.
4. The next screen will differ slightly depending on the engine driver you selected. The first item is the Data Source Name. This is how you will reference the database within DAQFactory. Use some unique name.
The rest of the items differ as mentioned, but typically there is a part that allows you to select the database file itself. There also may be some options that don't initially display.
5. Click on the Options>> button to expand them (if it exists for your database).
For example, with the Excel engine, one of these options is Read Only which must not be checked otherwise DAQFactory won't be able to add any data!
6. When done, click OK and the data source is created. You can edit your data source by highlighting it in the list and clicking Configure. You are now ready to use ODBC within DAQFactory.
To log to the database, select ODBC Database as the logging method in the logging set. Under Data Source enter the name of the data source (DSN) you created in the ODBC manager. Next, enter the name of the table within the database you would like to place the data. The table does not need to exist yet, and in general should not exist unless it was created by DAQFactory earlier.
Important Note: A very common mistake is to put the path name to your database (c:\databases\mydatabase.mdb for example) in the box for Data Source. This is incorrect and will not work. DAQFactory does not need or want to know the name of your database file. All it wants is the name of the data source created in the ODBC administrator.