LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Distributing an Application with Database ODBC Connectivity Using File DSN

After searching the forums and web for a solution to distributing and accessing a database using the LabView Database Connectivity Toolkit, I came across a solution not currently in the forum. Perhaps this is documented elsewhere, but I thought I'd put it here in case it helps in the future:
 
The LabView-documented method to use the "DB Tools Open Connection.vi" is by supplying a DSN. That makes distribution tricky as you then have to setup a DSN either via registry work or Control Panel work during installation of the built application. Here's a work around: Use File DSN.
 
Instead of supplying a traditional DSN to the Open Connection vi, provide this string:
 
filedsn=C:\mypath1\mydsnfile.dsn;DBQ=C:\mypath2\mydatabase.mdb;
 
where:
 
"C:\mypath2\mydatabase.mdb" is the installed location of the database file (in this case, an MS Access database)
 
and
 
"C:\mypath1\mydsnfile.dsn" is the installed location of a DSN text file (you can use notepad to make it) that looks like this:
 
[ODBC]
DRIVER=Microsoft Access Driver (*.mdb)
UID=admin
UserCommitSync=Yes
Threads=3
SafeTransactions=0
PageTimeout=5
MaxScanRows=8
MaxBufferSize=2048
FIL=MS Access
DriverId=25
The above file can be built using the database utility in control panel for other driver types (see the KB article reference below).
 
Using this approach, you are not relying on setting up a DSN on each machine that will run the installed application. Note: Make sure you specify a complete path to the files in the argument to the Open Connection vi.
 
References:

Message Edited by Wiredup on 02-21-2007 12:33 PM

Message Edited by Wiredup on 02-21-2007 12:34 PM

Message 1 of 1
(2,710 Views)