ODBC Driver Manager – Data source name not found and no default driver specified

While migrating an application from MSSQL 2005 and Server 2003 to MSSQL 2008 x64 and Server 2008 x64, I ran into an problem with the ODBC connection. The application uses a System DSN to connect to my BlackBerry Enterprise Server, BESMgmt. Settings were identical on both boxes, and verification within the ODBC manager worked.

When I tried to verify the DSN from within the app, I received the following error:

Can't connect, error [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

A variant of this error is:

Microsoft OLE DB Provider for Microsoft OLE DB Provider for ODBC Drivers (0×80004005)
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Most of the search results for that error turned up permission problems, and recommended explicitly granting access to the Registry key at the HKLM\SOFTWARE\ODBC\ODBC.INI. This wasn't my problem, and is also the reason that User DSNs exist.

It turns out that if you launch the ODBC Manager from the Start menu, you're getting the 64-bit version. 32-bit applications don't see DSNs created in the 64-bit ODBC Manager, and will fail one of the errors above.

The 32-bit ODBC Manager is located at C:\Windows\SysWOW64\odbcad32.exe

Launch that to manage DSNs for 32-bit applications and resolve this error.

ColdFusion – SQLServer JDBC Driver Unsupported data conversion

I always forget about this until I start working with ColdFusion and MSSQL again.  You're plugging along, and suddenly a page that was previously working starts throwing an error:

Error Executing Database Query.
[Macromedia][SQLServer JDBC Driver]Unsupported data conversion.

Relax, your code is (likely) fine.  This typically happens when you add a column to your table and use "SELECT *" in the query.  Somewhere along the line the list of columns is cached and since the list of columns you're selecting in the query hasn't changed ColdFusion chokes when what it receives doesn't match what it expects.

The fix couldn't be simpler – just toss a semi-colon at the end of your CFQUERY and watch your problems go away.  If you make another change just remove the semi-colon.

So a query that looks like this:

<CFQUERY NAME="qryUsers" DATASOURCE="dsn">
	SELECT * FROM users
</CFQUERY>

Becomes:

<CFQUERY NAME="qryUsers" DATASOURCE="dsn">
	SELECT * FROM users;
</CFQUERY>

I fully expect that I'll be stumbling across this page in 6 months.


© 2007-2013, Corey Gilmore | Posts RSS Feed | Comments RSS Feed | Contact

 

The views expressed on these pages are mine alone and not those of any past or present employer. All information presented on this site was obtained lawfully and not through disclosure under the terms of an NDA.