Using a file DSN with an OleDbConnection

I'm looking for a connection string for a file DSN to be used from an OleDbConnection

I have no problem in setting up the connection string for UDL files or connecting to CSV, XLS or MDB but I'm having a problem with DSN.

The DSN will be built by the user so I'll only know the name of the DSN file and not what database they are connecting to.

If I just put in ==> FILEDSN=c:\myData.dsn; to the connection string I get an error saying that it requires a Provider.

I'm using VS 2005 coding in VB for .NET Framework 2.0
hotshottoolsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mirtheilSoftware DeveloperCommented:
DSNs are used by ODBC, so you'd need to use an OdbcConnection.  I'm VB6, you could specify "DSN=" for ADO and it just used the OLEDB - ODBC bridge but with .NET, Microsoft split ODBC and OLEDB into two interfaces (OleDbConnection and OdbcConnection).  
The reason for the error is because OLEDB requires a "Provider=" key pair to work correctly so ADO.NET knows which OLEDB provider to use.  
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hotshottoolsAuthor Commented:
mirtheil;

I'll give that a shot later today (It sounds like it will)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.