LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Create an Access data source by programming

I use Win32 API SQLConfigDataSource to create a .mdb data source, an link error occured after including odbcinst.h and adding odbccp32.lib in my project. How to solve this problem?

0 Kudos
Message 1 of 9
(4,580 Views)

Hello Harry76,

 

Could you please give us more details? What version of LabWindows/CVI are you using? What is the error message?

 

Thank you and best regards,

=Nelu F. || National Instruments.

0 Kudos
Message 2 of 9
(4,576 Views)

I use Microsoft Access 2003 database in my LabWindows project, and access data with SQL Toolkit. Generally, I create data source in Windows ODBC data source manager before the program connects .mdb database. This is an unpleasant method for user who use my software, so I want to use API SQLConfigDataSource in odbcinst.h to configure the data source directly. And I also add the odbccp32.lib in my project. An link error occured as following:

1 Project link error
Undefined symbol '__imp___vsnprintf' referenced in "odbccp32.lib".

As I know this function is defined in stdarg.h, the stdarg.h is included in ansi_c.h. This error message has confused me!

How can I solve this problem?

Thank you.

0 Kudos
Message 3 of 9
(4,568 Views)

Hello Harry76,

 

The error message is helpful, but we still need to know the version of the SQL Toolkit and of LabWindows/CVI. You can find the version number for CVI from Help > About LabWindows/CVI and that of the SQL Tookit from Control Panel.

 

Thanks!

=Nelu F. || National Instruments.

0 Kudos
Message 4 of 9
(4,565 Views)

Hello Harry,

 

This is a known issue from Microsoft, since 2010.

http://connect.microsoft.com/VisualStudio/feedback/details/470376/odbc-application-linking-with-odbc...

The workaraund is to use odbccp32.lib from the Windows Vista SDK instead.

 

Constantin

0 Kudos
Message 5 of 9
(4,533 Views)

Hello, I have a same problem as yours. Could you tell me how to solve this problem? Thank you very much,

 

When my program compile and run with LabWindows CVI 9.0,there is no problem.

 

Then I try it with LabWindows 2013, This error comes out.

0 Kudos
Message 6 of 9
(4,118 Views)

Thank you ,I have solved this problem . I replaced odbccp32.lib in my CVI 2013 project with the other odbccp32.lib in my CVI 9.0 project.

 

Their file size are diffirent.But I still don't know the deeply reasons. By the way  , my English is pool ,HaHa.

0 Kudos
Message 7 of 9
(4,112 Views)

Hello Claus and welcome to the LabWindows/CVI forum.

 

The reason is that odbccp32.lib shipped with CVI 2013 is broken.

In CVI 2010 the SDK was updated to Windows 7 SDK that has this problem.

 

Constantin

0 Kudos
Message 8 of 9
(4,103 Views)

Hello Constantin

 

Thanks for your help. I'll consider to use Access with advanced version after finishing this project.

 

Claus

0 Kudos
Message 9 of 9
(4,086 Views)