---
title: "Avoiding DB_SEC_E_AUTH_FAILED exception on connection string"
url: "https://osherove.com/blog/2003/4/3/avoiding-db_sec_e_auth_failed-exception-on-connection-string.md"
canonical: "https://osherove.com/blog/2003/4/3/avoiding-db_sec_e_auth_failed-exception-on-connection-string.html"
published: "2003-04-03T10:18:00"
updated: "2003-04-03T10:18:00"
tags: []
author: "Roy Osherove"
description: "Thought I should share, since i could find almost no reference to this on the web... I came accross this weird message when trying to set the connection string on the connection object to point to an MDB file on my…"
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# Avoiding DB\_SEC\_E\_AUTH\_FAILED exception on connection string

By Roy Osherove April 3, 2003

**Historical article** · Originally published April 3, 2003; technical details may be outdated.

Thought I should share, since i could find almost no reference to this on the web...

I came accross this weird message when trying to set the connection string on the connection object to point to an MDB file on my drive, using this connection string:

@"Provider=Microsoft.Jet.OLEDB.4.0;Password="";User ID=Admin;Data Source=C:\\Documents and Settings\\royo\\My Documents\\WOZ.mdb;Mode=Share Deny None;Extended Properties="";Jet OLEDB:System database="";Jet OLEDB:Registry Path="";Jet OLEDB:Database Password="";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False"

The way to repair it is pretty simple:

Notice that I put a '@' at the start to format the string correctly, since it contains double quotes and stuff. Appearently, this is not enough. to fix this you need to replace each pair of double quotes to 2 pairs of double quotes like so:

**Password="";**   turns into **Password="""";**

repeat this for all values containing double quote pairs in the string and your done.

and that should fix it

Replace all double


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
