Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

ODBC/Access Problem

I never used Access before I started to use CityDesk (SQL Server only), so maybe I simply need some know-how.

When I need an ODBC data source based on an SQL Server, I create such an ODBC data source without the need to specify a certain database at this point. This let me use ONE single ODBC data source for dealing with numerous databases with SQL server.

When creating an ODBC data source for dealing with access, Windows let me create such a data source without specifying a certain database, too. When I try to use this data source from my program it don't work.

If I specify the databse in the ODBC data source, all works fine, but I need one data source for every Access database I want deal with - I am not happy with this!

Or is there a way to specify the database later, when establishing a connection, in a way that differs from SQL Server syntax?

Thanks a lot in advance!

Kai Jäger
Tuesday, February 24, 2004

You're referring to creating data sources in the control panel's ODBC ?

In your code, rather than specifying a connection string that uses the data source (DSN), specify a DSN-less string. This way you don't need to create any ODBC datasources.

There's lots of examples available via Google - search for "ASP DSN" (or "ASP DSNless"). The neatest I came across was on (for an Access example)

Tuesday, February 24, 2004

Michael H. Pryor
Fog Creek Software
Tuesday, February 24, 2004

That is exactly the information I need - thanks a lot!

Kai Jäger
Wednesday, February 25, 2004

*  Recent Topics

*  Fog Creek Home