08-14-2017 11:06 AM
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.
08-14-2017 11:23 AM
I assume you are on Win64.
Use the ODBC tool found in c:\Windows\sysWOW64\odbcad32.exe.
08-14-2017 11:31 AM - edited 08-14-2017 11:32 AM
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.
08-14-2017 01:25 PM
To remove that possibility, I have just hardcoded the connection string in the mean time.
08-14-2017 01:26 PM
This is the error that keeps showing up.
08-14-2017 01:39 PM
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.
08-15-2017 10:53 AM
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?
08-15-2017 11:05 AM
What is your connection string?
08-15-2017 11:26 AM
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Test_Database;Data Source=SQLTEST
08-15-2017 11:27 AM
I've also tried a UDL which didn't change the outcome either.