LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use ODBC with LabWindows/CVI

I am using LabWindows/CVI to verify the correct functionality of an Electronic Control Unit. I want to extract the constant values that are already in the scripts (libraries) from an ODBC data base. I would like to know if LabWindows/CVI can make use of ODBC to handle some information (request and update information, queries, etc.). And how?

Regards,

Bernardo Lopez
0 Kudos
Message 1 of 3
(3,442 Views)
Bernardo,

I believe (but I am not positive)that labwindows has a package you can buy that helps with ODBC. However you don't need to have this in order to use ODBC with C.

If you wish to use ODBC with C, you will have to follow these steps:
1.) Go to Microsoft.com and download the MDAC 2.7+ and windows SDK core software (this will provide you with ODBC .dll's and headers that you will need)
2.) Include 'windows.h' and "sqlext.h" in your project (in the order listed or you will get errors)
3.) The following link provides a good piece of example code that can get you started with using ODBC in C http://www.coding-zone.co.uk/cpp/articles/090101codeodbc.shtml

If you choose to go this route and not with the CVI custom package, I would suggest creating a .dll with your own custom ODBC functionality, otherwise anyone who wants to edit your code in the future will need the MDAC 2.7+ and windows SDK core (which is a large download) to actually compile your program.

Good luck!
Message 2 of 3
(3,433 Views)
If you have CVI Full Development System (FDS), you should already have the Windows SDK included with CVI. The SDK that comes with CVI is customized for use with an ANSI C compiler, so downloading the SDK headers and libs from the Microsoft site might not work with CVI.

By default, the Windows SDK option is disabled in the installer feature tree, so you might not have installed it (if you have CVI FDS). You can run the CVI installer and check the feature tree to make sure whether you already have it installed or not.
Bilal Durrani
NI
Message 3 of 3
(3,430 Views)