OleDB connection string examples

MS Access (Jet)
"PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=[Path to database];User ID=Admin;Password=dbpassword" 
  • You can use Server.Mappath function to identify Path to your database.  For example, if the DB file is in the /database directory under your web root, you would use server.mappath("/database/test.mdb").  As an alternative, you can also insert the full path.  You can find the path in the Site Info Manager section in your control panel.
  • You can omit the User Id & Password attributes, if your Access Database is not password protected.
"Provider=sqloledb;Data Source=[SQLServerName];Initial Catalog=[DatabaseName];User Id=[SQL Login];Password=[SQL Password]"
  • For ASP.NET applications, you should consider using the .NET native SQL data provider rather than using Ole
  • You can find the SQL server information in the Site Tools section of Control Panel
If you run in to problems using this code, please post in our community forum. Technical support cannot assist with specific coding related issues.