LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

database connection via UDL file

Solved!
Go to solution

I successfully developed a LabVIEW 2018 SP1 (32-bit) application (.EXE) to connect to a database using a UDL file. The file was created via Data Link in LabVIEW 2018 SP1 (32-bit).

 

This EXE file is then distributed to non-LabVIEW PC operators who are only required to install LabVIEW 2018 SP1 Run-Time Engine.

 

However, the application (EXE) failed to connect to the database. How do I fix this problem for these non-LabVIEW PC's ?

 

Here is the content of the UDL file:

 

[oledb]
; Everything after this line is an OLE DB initstring
Provider=MSOLEDBSQL.1;Password=Td@c$123_;Persist Security Info=True;User ID=svc_bh_setupuser;Initial Catalog=TDACS;Data Source=TXBDSTLGPRP01;Initial File Name="";Trust Server Certificate=True;Server SPN="";Authentication="";Access Token=""

 

0 Kudos
Message 1 of 10
(3,261 Views)

The UDL file tells the application to use the MSOLEDBSQL driver but is that driver installed on the user PC?  If you double-click the UDL file, are you able to successfully test the connection to your database? 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 10
(3,246 Views)

Dear aputman,

 

If I double-click the UDL file, and test the connection, it is successful {see attachment}.

 

Thanks for reminding me of checking the "Microsoft OLE DB Driver for SQL Server (MSOLEDBSQL)" driver.

 

If the PC user does NOT have it, do I download the driver from Microsoft ?

 

0 Kudos
Message 3 of 10
(3,232 Views)

If the test succeeds, this means the driver is already installed.

What error are you receiving in the LabVIEW program?  

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 4 of 10
(3,228 Views)

Hello aputman,

 

Sorry, the UDL successful connection was tested from my laptop.

 

I tested the UDL from one of the PC users, and I got an error in Microsoft Data Link {see attachment}. Does this mean the MSOLEDBSQL driver is not installed ?

 

0 Kudos
Message 5 of 10
(3,217 Views)

Correct.  You can find it at this website:

 

https://docs.microsoft.com/en-us/sql/connect/oledb/oledb-driver-for-sql-server?view=sql-server-ver15

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 6 of 10
(3,210 Views)

Read notes 1, 2 and 3 in the article.  It talks about two providers that have been deprecated, one of them being the one you have specified in your connection string (SQLOLEDB).  You'll want to change this to MSOLEDBSQL after installing the driver.  

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 7 of 10
(3,202 Views)

Thanks, aputman,

 

"Provider=MSOLEDBSQL" is the only string in my UDL file, so I don't worry about conversion.

 

Your Website link contains identical 32- and 64-bit drivers.

 

My LabVIEW 2018 SP1 is 32-bit running on my 64-bit laptop, and the database server I am told is 64-bit. I guess I will just install the 64-bit driver for my 64-bit PC users.

 

Will let you know how my application (EXE) works on those PC's.

 

0 Kudos
Message 8 of 10
(3,193 Views)

Thanks for your help, aputman,

 

After installing the 64-bit MSOLEDBSQL driver on one of the PC users, I tested the UDL connection, and it was successful.

 

My application (EXE) works!

 

0 Kudos
Message 9 of 10
(3,178 Views)
Solution
Accepted by topic author cha@bellflight.com

Great.  I'm glad you were able to get this solved. 

Please mark one of the replies as the solution so others know that this question is solved.  Kudos are also appreciated.  

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 10 of 10
(3,173 Views)