MS Access MDB를 위한 DB Connection String

by digipine posted Oct 29, 2017


PrevPrev Article

NextNext Article


Larger Font Smaller Font Up Down Go comment Print

MS의 Access MDB 파일을 Database 로 사용할 경우가 있는데요.
이때 Connection String 값을 정리해 보았습니다.

1. ODBC를 사용할 경우

- 일반적인 보안
Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;Uid=Admin;Pwd=;

- Workgroup 보안
Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;SystemDB=C:\mydatabase.mdw;

- Exclusive 보안
Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;Exclusive=1;Uid=admin;Pwd=;

- Enable admin statements
To enable certain programatically admin functions such as CREATE USER, CREATE GROUP, ADD USER, GRANT, REVOKE and DEFAULTS (when making CREATE TABLE statements) use this connection string.

Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;Uid=Admin;Pwd=;ExtendedAnsiSQL=1


- Specifying locale identifier
Use this one to specify the locale identifier which can help with non-US formated dates.

 Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;Locale Identifier=2057;Uid=Admin;Pwd=;

2. OLE DB, OleDbConnection (.NET)을 사용할 경우

- 일반적인 보안
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;User Id=admin;Password=;

- With database password
This is the connection string to use when you have an access database protected with a password using the Set Database Password function in Access. 
 Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;Jet OLEDB:Database Password=MyDbPassword;

- Workgroup (system database)
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;Jet OLEDB:System Database=system.mdw;

- Workgroup (system database) specifying username and password
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;Jet OLEDB:System Database=system.mdw;User ID=myUsername;Password=myPassword;

- DataDirectory functionality
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\myDatabase.mdb;User Id=admin;Password=;