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: 

SQL Server and Win 7 Issue

I have an existing User DSN SQL Server driver created on an XP machine, my driver listed is sqlsrv32.dll version 2000.85.1132.00.  I have created a small program to access the SQL database, read the list of tables and then close the connection; it does that just fine.  When I assemble the program and run it on a machine that has Win 7 (sqlsrv32.dll version 6.01.7600.16385) I get an error that it can not open the SQL database.

 

When I created the new User DSN on the Win 7 machine, it showed that the connection is good and past the test.

 

Program created using LV 2011.

 

Thank you inadvance for any assistance!

0 Kudos
Message 1 of 10
(4,006 Views)

I found another post that resolves the issue, where they talk about using the C:\windows\syswow64\odbcad32.exe file that is 32 bit.  Which is great, but I cannot find the sysWOW64 folder on that win 7 machine!

0 Kudos
Message 2 of 10
(4,000 Views)

Hi Chas,

 

Can you please post the url of the other post you found?  This may help us understand your issue.

 

Thank you!

 

Regards,

 

Dayna P.

Applications Engineer

National Instruments

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

Hi Dayna,

 

http://forums.ni.com/t5/LabVIEW/MySQL-Connection-Error/m-p/2180266

 

Although, upon further reading this whole thing with the folder c:\windows\SysWOW64\odbcad32.exe; I am finding that this folder is supposed to be already installed on a Win 7 machine.  Been finding this on other non-NI message boards, do you know if this is true or not??

0 Kudos
Message 4 of 10
(3,969 Views)

Hi Chas,

 

It is true that the folder you referred to is not installed on a Windows 7 machine.  This requires that you download the database software.

 

Regards,

 

Dayna P.

Applications Engineer

National Instruments

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

What is weird, is I have been looking at other Windows 7 machines and they have the folder in question.  None of those perform any database activities, i.e. my personal pc at home had the folder.

0 Kudos
Message 6 of 10
(3,933 Views)

[I know this is an old thread, but this may help someone else]

 

The SysWOW64 folder is only present on 64-bit installations of Windows.

 

The issue (in short; see the link mentioned above for more) is that LabView only accesses SQL using 32-bit libraries, which requires a 32-bit ODBC definition.  On 32-bit Windows, that's all there is, so no problem.  On 64-bit Windows, the default ODBC configuration tools configure a 64-bit ODBC definition.

 

Since you don't have SysWOW64, you are (hopefully) running on 32-bit Windows, so that shouldn't be the issue.  I recommend avoiding User DSN, and use System DSN instead.  Only the Windows Login you used to create the User DSN will have access to it (could be the issue here).  There is also a risk there are more than one DSN by the same name.  Knowing the exact message from the error might help.  You can probably tell if the DSN is missing or inaccessible vs. just not working.  Sometimes, you have to pass a password to the Open DB, even though you include one in a DSN.  The error message should pinpoint that, too.

___________________
CLD, CPI; User since rev 8.6.
0 Kudos
Message 7 of 10
(3,496 Views)

Even easier is to use a connection string instead!


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 8 of 10
(3,431 Views)

Very true (regarding using a connection string).  

 

I had a very hard time finding documentation on that, though.  The simple trick is to use LabView to create a .udl file.  The tool is on most LabView windows, in the menu item 'Tools'/'Create Data Link...' (toward the bottom).  The wizard is similar to ODBC.  Then, open the .udl file with notepad (it's a simple text file), and copy & paste that as the 'connection information' input to DB Tools Open Connection.vi (it will automatically switch to a string input instead of path).

 

___________________
CLD, CPI; User since rev 8.6.
0 Kudos
Message 9 of 10
(3,425 Views)

Google ("odbc connection string") is your friend: https://www.connectionstrings.com

 

Look up the ODBC connection string for your database engine and away you go! I think you can actually open the .udl files in notepad perhaps?


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 10 of 10
(3,411 Views)