LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -2147467259 w/ DB Tools Open Connect while using .exe

I am using LabVIEW 2015 (32-bit) and I am having an issue connecting to a SQL database while running the executable. The program works fine while in the development environment but once it's built the .exe won't connect. I'm connecting through the DB Tools Open connection default vi and feeding it a connection string from a config file.

 

Any help would be appreciated.

0 Kudos
Message 1 of 17
(4,015 Views)

I assume you are on Win64.

Use the ODBC tool found in c:\Windows\sysWOW64\odbcad32.exe.

 

aputman
0 Kudos
Message 2 of 17
(4,007 Views)

Also what does your connection string look like?  Are you sure that you're reading the connection string properly from the config file?  Do you have the proper path to the config?  Most often, when reading from a file works in DevEnv but not in EXE, there is an issue with the path. 

aputman
0 Kudos
Message 3 of 17
(4,002 Views)

To remove that possibility, I have just hardcoded the connection string in the mean time.

0 Kudos
Message 4 of 17
(3,976 Views)

This is the error that keeps showing up.

0 Kudos
Message 5 of 17
(3,975 Views)

Did you try using the ODBC tool in the sysWOW64 directory to configure the connection?  Either the connection string is wrong or you are using the wrong ODBC tool.

aputman
0 Kudos
Message 6 of 17
(3,970 Views)

The connection string is correct as I can access the database in the development environment and the string does not change. I'm not quite sure how to use the ODBC tool, and IT is not quite sure how it needs to be configured. Can you clarify on that?

0 Kudos
Message 7 of 17
(3,922 Views)

What is your connection string?

aputman
0 Kudos
Message 8 of 17
(3,916 Views)

Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Test_Database;Data Source=SQLTEST

0 Kudos
Message 9 of 17
(3,910 Views)

I've also tried a UDL which didn't change the outcome either.

0 Kudos
Message 10 of 17
(3,909 Views)