[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.odbcnet

Connecting to a System DSN?!

=?iso-8859-1?Q?Joel_Fjord=E9n?=

11/15/2002 8:26:00 PM

Hi,

I have a problem about how to do a connection to a=20
microsoft access database through an ODBC System DSN.

When I try to do it with OleDB it says that it doesn't=20
support it. I have also tried to download and use the=20
ODBC .NET Data Provider, but the JET (Microsoft Access)=20
provider there only lets you specify an absolute path to=20
the *.mdb file and I want to specify a system dsn.

Please let me know if you=B4ve got any solutions to this!?

/ Joel
1 Answer

(Hussein Abuthuraya(MSFT))

11/16/2002 12:41:00 AM

0

Joel,

Yes, if you want to use a DSN in your connection string (User DSN or System DSN) you need to use the ODBC.NET Data Provider. To accomplish this, just build the System
DSN using the ODBC Data Source Admin tool. In the tool you have to browse to the mdb file location. Then in your code just use:

Dim cnOdbc as OdbcConnection = New OdbcConnection("DSN=myAccessDSN")

Let me know if you have additional questions.


Thanks,
Hussein Abuthuraya
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Microsoft Strategic Technology Protection Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.co....