From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 2147467259 DB Tools open connection

Solved!
Go to solution

I wrote a program in labview 2014 32 bit to pull data from a MS SQL Server database.  I used the 32bit ODBC datasource program to generate a DSN file.  The code works just fine when I run the VI from labview, but when I build the program and run the executable, I get an error: 

 

ADO Error: 0x80004005
Exception occured in Microsoft OLE DB Provider for ODBC Drivers: [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. in NI_Database_API.lvlib:DB Tools Open Connec (String).vi->RecipeSelect.vi

 

I created a UDL file with the labview "Create data link" tool and I still get the same error even though the VI runs fine.  I have also tried a connection string.  All the searches I have done on this error suggest a problem between 64bit and 32bit data sources.  I've tried creating them both ways and still get the same error, yet the VI always runs fine on the same computer from labview.

 

Any suggestions on what to try next?  Thanks in advance.

0 Kudos
Message 1 of 5
(6,618 Views)

Hello JeffPaluck,

 

Are you running the executable as an administrator? Also just to clarify, are you running this executable on your development machine or on a different computer when you receive the error? 

 

Jonathan

0 Kudos
Message 2 of 5
(6,565 Views)

I'm not running the executable as administrator.  I tried just now and it still failed to work. I'm receiving the error on the same machine used for development.

0 Kudos
Message 3 of 5
(6,556 Views)

Hello JeffPaluck,

 

How are you giving the DB Tools Open Connection.vi connection information? Is the file path to your DSN file hardcoded or are you using relative path VI (ex Application Directory VI) to locate it. Have you tried running your development code and your executable on another computer?

 

 

Message 4 of 5
(6,528 Views)
Solution
Accepted by topic author Jeff@VMI

The file path was hardcoded.  I tried running it on multiple machines with the same error.  I have since created a new project and started rebuilding the code from scratch.  I think something in my old files are corrupted as the new code is working after I build it.  *fingers crossed*  Thanks for taking the time to respond and try and help!  Much appreciated 🙂

 

Edit:  I had tried changing so many things to get my project to work that I don't know what I might have messed up in the process.  Marking this as solved because the original problem is so convoluted it was likely my own mistake with the creation of the DSN/UDL file or maybe even a glitch with our SQL Server.  It has since been rebooted.

0 Kudos
Message 5 of 5
(6,520 Views)