LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

distributing database connection with application

Hi,

I'm building a test system that is to be distributed as an application, and that is to work towards a SQL server using the Database Connectivity Toolset. What I would like to do is to distribute the connection together with the installation, either in a *.ini file or as some other support file.

Is this possible to do?

Thanks.


CLA
https://www.prevas.se/expertis/test--regulatoriska-krav.html
0 Kudos
Message 1 of 4
(2,960 Views)
You have several options.
  1. Use the configuration file VIs found in the File palette

  2. Write the info in your own format (text or binary)

  3. Create a data structure and flatten to XML, then save that to a file
There are probably other options as well. The key thing is to install the file so you know where it is. If you are using the LabVIEW app builder to create your installation, make sure you specify the support file as such in the app builder.
0 Kudos
Message 2 of 4
(2,958 Views)
As you already know, the only way to describe the connection to a database such as SQL Server is to either define a DSN (data source name) through the ODBC Administrator in the Windows Control Panel or through creating a UDL file using the Microsoft Data Link dialog. Here are some of the options:

1) System and User DSNs are just registry entries. So you can actually write a LabVIEW program to define the proper DSNs on the target machine. Some installation applications like Wise for Windows have options for creating these DSNs for you.

2) File DSNs and UDL files are just text files that define all the connection information. Therefore, you can either make these files from scratch by parsing and remaking either of these files on the target machine or if the paths and other information are the same on the target as they were on your development machine, then you can just install these files to the same location as is.

3) Using an ini file to store the various pieces of database connection information can be a starting place but in the end, you either need to have your LabVIEW app create a DSN or a UDL since that is the only type of connection the database is going to understand.

Let me know if you need more help or want to discuss this more.
Message 3 of 4
(2,951 Views)
Hi again,

After a couple of months implementing my system it is time to distribute it, and of course I got problems with the database connection.

After reading the manual for the database connectivity toolset I've included the udl-file with the installation, I've also included the mdac_typ.exe file and request the installation to run it with the parameters described in the manual. Unfortunately I'm not able to use the build script shipped with the toolset since I'm using another auto generated build script that takes care of numerous dynamic calls (GOOP is used), hence I'm forced to manually enter the parameters needed to get the toolset to work in an application.

Now what happens is this: On computers where LabVIEW and the toolset is installed I get everything to work fine. However, on computers without LabVIEW I can't get it to work. The udl is shipped with the installation and when the connection is tested no problems are reported. One problem might be that I'm using an English mdac 2.5 on a Swedish operating system, but I can't find the english version to uninstall it, and mdac will not let me install the Swedish "on top of" the English version.

Unfortunately I haven't implemented a very good error handler, so I can't see why the application is unhappy. Even more unfortunately I do not have access to the database much, so the next time I have access to it I'd like to have a good idea of where to start looking for the problem.

So, my questions are:
1. Could the mismatch English mdac/Swedish operating system cause my problems?
2. How do I uninstall mdac? (more of a microsoft question, but if anyone here knows...)
3. Have I overseen anything?

Greatful for help.


CLA
https://www.prevas.se/expertis/test--regulatoriska-krav.html
0 Kudos
Message 4 of 4
(2,871 Views)