Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Tutorial
NI Supported: Yes
Publish Date: Dec 10, 2007

Setting up a Database through ODBC

36 ratings | 2.22 out of 5
Print

To use the LabVIEW SQL toolkit to connect to a database file, you first need to setup the file using the ODBC Administrator. This is similar to assigning a device number to a data acquisition board in the Measurement and Automation Explorer. When you configure the Data Source Name, or DSN, use that name to refer to the specified database in LabVIEW.

Open your Control Panel from the Start menu and open the 32-bit ODBC Administrator.

The ODBC Administrator window has several tabs running along the top.

- User DSN tab -- Configures data sources that can be used by only the current user of the computer.

- System DSN tab -- Configures data sources that can be used by any user that logs in to that specific machine.

- File DSN tab -- Configures data sources that can be used by any user on your network that has the same drivers.

The Drivers tab lists all of the installed drivers on the current computers. It also provides information on the driver’s version, manufacturer, file name, and the date the driver was compiled.

All of the driver files are stored in the Windows System directory.

The tracing tab allows you to produce a log file that contains all of the SQL calls that pass through the driver.

The majority of users use either User or System data source names.

To configure a new DSN, or Data Source Name, complete the following steps.

Click the Add button. A window with a listing of all the available drivers appears.

Select the driver for the database you want to connect to and click Finish.

Configure your datasource in the window that appears. This window is database specific and looks different based on which database driver was selected.

Usually it asks you to name the data source and provide the path to the database. This path can be local, or it can be the path to another computer on your local network.

When you are finished, you can use the name you defined to connect to the database from LabVIEW.


36 ratings | 2.22 out of 5
Print

Reader Comments | Submit a comment »

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).