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.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Why do SQL sample programs work when there is no entry for the data sources in the ODBC Data Source Administrator that are used by the sample program?

Hi,

 

I am trying to understand how to access an SQL database from CVI.  

 

I don't understand how the sample programs shipped with the toolkit can access the database they use if it is not listed in the ODBC Data Source Administrator.

 

In the code, I see the line:


hdbc = DBConnect ("DSN=CVI SQL Samples");

 

However, there is not an entry that I can find in the ODBC Administrator for "CVI SQL Samples."

 

The SQL help suggests there should be a User DSN named, "CVI32_Samples", but I don't see that entry in the ODBC Administrator on my win-7 system.

 

I believe the sample program is accessing a database file named, "C:\Users\Public\Documents\National Instruments\CVI\Samples\sql\samples.mdb".

 

Exactly how is the call to DBConnect() translated to the file, "samples.MDB", if there is no entry in the ODBC Administrator?

 

Regards,

Mark 

 

 

0 Kudos
Message 1 of 2
(2,603 Views)

I figured it out.  There is a 32 bit ODBC administrator and a 64 bit ODBC administrator.  The ODBC administrator I run through the control panel is the 64 bit ODBC administrator. To access the 32 bit administrator I need to run, "C:\Windows\SysWOW64\odbcad32.exe".

 

I am running the samples in 32 bit mode, so I need to use the 32 bit ODBC administrator.

 

Best,


Mark

0 Kudos
Message 2 of 2
(2,598 Views)