OleDB connection string examples – SQL server and Microsoft Access

An OLE DB connection enables to connect to a data source by using an OLE DB provider. For example, an OLE DB connection manager that connects to Microsoft Access database or SQL Server can use the Microsoft Access Jet or Microsoft OLE DB Provider for SQL Server.

Following is the sample connection string for Microsoft Access (Jet OleDB):

Instead of providing full path of your Microsoft Access database, you can use Server.Mappath function as well. You do not need to specify username and password if your Microsoft Access database is not password protected.

Following is the sample connection string for Microsoft SQL server (using OleDB connection):

For ASP.Net application, you should consider using the .Net native SQL data provider rather than using OleDB connection string.

Posted in Connection Strings and tagged , .

Leave a Reply

Your email address will not be published. Required fields are marked *