[QODBC-Desktop] Troubleshooting: Error when using QODBC with Visual Studio 2008
Posted by brad waddell on 12 March 2009 05:21 PM
Troubleshooting: Error when using QODBC with Visual Studio 2008
I am trying to use QODBC connection using Visual Studio 2008.
The 2.1 Compatibility option in QODBC Setup Screen -> Advanced tab is unchecked.
Test Connection works fine. Server Explorer Data Connections works fine.
I attempt to add a new Data Source [Database / ODBC..QODBC / New Connection / Data source: Microsoft ODBC Data Source / Use user or system data source name: QuickBooks Data / Test Connection -> Test connection succeeded. / OK / Next > / Next > / Retrieving Database information. / An error occurred while retrieving the information form the database:
Selecting objects of type 'Procedure' is not supported.
This is actually a Visual Studio 2008 bug, you will need to install VS2008 SP1.
For those who use the 64-bit system
And please notice, if you are using a 64-bit system, specify x86 as Target CPU in Visual Studio 2008.
Change project properties| Advanced Compile Options... | Target CPU | x86
When this was done, the sample code (below) worked.
You should still be able to connect to the ODBC data source using the OdbcConnection class (http://msdn2.microsoft.com/en-us/library/system.data.odbc.odbcconnection.aspx).
The following code is the minimal code required to create a DataSet from the SQL statement and attaches the dataset to a DataGrid:
Dim cnQODBC As System.Data.Odbc.OdbcConnection
cnQODBC = New System.Data.Odbc.OdbcConnection("DSN=QuickBooks Data")