Can you provide me with some OleDB connection string examples?

MS Access (Jet)

\"PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=[Path to database];User ID=Admin;Password=dbpassword\"

Note

If you\'ve uploaded your MDB file in DB folder, you need to use physical path like d:\\\\domains\\\\yourdomain.com\\\\db\\\\yourdb.mdb
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 Account Information section in your control panel.
You can omit the User Id & Password attributes, if your Access Database is not password protected.
MS SQL

\"Provider=sqloledb;Data Source=[sql.yourdomain.com];Initial Catalog=[DatabaseName];User Id=[SQL Login];Password=[SQL Password]\"

Note

For ASP.NET applications, you should consider using the .NET native SQL data provider rather than using Ole.

Was this answer helpful?

 Print this Article

Also Read

Do you allow custom COM components?

No we do not offer installation of custom COM components. Custom COM components...

Sending mail via Persits.MailSender

Here's a complex example of sending an email with SMTP authentication and attachments. <%...

500 Internal Server Error

In Windows hosting, sometimes you may get the error message "500 Internal Server Error" for...