09-17-2020 12:58 PM
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=""
Solved! Go to Solution.
09-17-2020 01:39 PM
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?
09-17-2020 01:58 PM
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 ?
09-17-2020 02:03 PM
If the test succeeds, this means the driver is already installed.
What error are you receiving in the LabVIEW program?
09-17-2020 02:16 PM
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 ?
09-17-2020 02:26 PM
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
09-17-2020 02:31 PM
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.
09-17-2020 02:43 PM
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.
09-17-2020 03:07 PM
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!
09-17-2020 03:11 PM
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.