Sie sind auf Seite 1von 3

Access 2007 Connection String Samples - ConnectionStrings.

com

Developers community number 1 connection string reference

Reference

Articles

Forums

Contributors

About

Retro

Advertise

Connection strings for Access 2007


OLE DB providers for Access 2007
ACE OLEDB 12.0

Sign-in or Join

Share

Developers Community
Find solutions and post questions regarding connection string related issues. Forum for Access 2007

Popular
Connection strings explained Rules for connection strings Store connection string in web.config Connection Pooling

ODBC drivers for Access 2007


Microsoft Access accdb ODBC Driver

.NET libraries for Access 2007


.NET Framework Data Provider for ODBC - OdbcConnection .NET Framework Data Provider for OLE DB - OleDbConnection

ACE OLEDB 12.0


OLE DB Provider Provider=Microsoft.ACE.OLEDB.12.0 MANUFACTURER Microsoft
TYPE USAGE

More info and provider downloads Set example values

Standard security
Provider= Microsoft.ACE.OLEDB.12.0 ; Data Source= C:\myFolder\myAccess2007file.accdb ; Persist Security Info = False ;

With database password


This is the connection string to use when you have an Access 2007 database protected with a password using the "Set Database Password" function in Access.

Provider= Microsoft.ACE.OLEDB.12.0 ; Data Source= C:\myFolder\myAccess2007file.accdb ; Jet OLEDB:Database Password= MyDbPassword ;


Some reports of problems with password longer than 14 characters. Also that some characters might cause trouble. If you are having problems, try change password to a short one with normal characters.

DataDirectory functionality
Provider= Microsoft.ACE.OLEDB.12.0 ; Data Source= |DataDirectory|\myAccess2007file.accdb ; Persist Security Info = False ;

Network Location
Provider= Microsoft.ACE.OLEDB.12.0 ; Data Source= \\serverName\shareName\folder\myAccess2007file.accdb ;

Microsoft Access accdb ODBC Driver


ODBC Driver Driver={Microsoft Access Driver (*.mdb, *.accdb} MANUFACTURER Microsoft
TYPE USAGE

More info and driver downloads Set example values

Standard Security
Driver= {Microsoft Access Driver (*.mdb, *.accdb)} ; Dbq = C:\mydatabase.accdb ; Uid = Admin ; Pwd = ;

http://www.connectionstrings.com/access-2007[18/12/2012 11:37:23 AM]

Access 2007 Connection String Samples - ConnectionStrings.com

Workgroup
Driver= {Microsoft Access Driver (*.mdb, *.accdb)} ; Dbq = C:\mydatabase.accdb ; SystemDB= C:\mydatabase.mdw ;
No changes were made to the .mdw file format for Office Access 2007. The Office Access 2007 Workgroup Manager creates .mdw files that are identical to those that are created in Access 2000 through Access 2003. The .mdw files that are created in those earlier versions can be used by databases in Office Access 2007.

Exclusive
Driver= {Microsoft Access Driver (*.mdb, *.accdb)} ; Dbq = C:\mydatabase.accdb ; 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, *.accdb)} ; Dbq = C:\mydatabase.accdb ; 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, *.accdb)} ; Dbq = C:\mydatabase.accdb ; Locale Identifier = 2057 ; Uid = Admin ; Pwd = ;

The above example uses the en-gb locale identifier (2057)

.NET Framework Data Provider for ODBC


.NET Framework Wrapper Class Library System.Data.Odbc.OdbcConnection MANUFACTURER Microsoft
TYPE USAGE

More info and wrapper class library downloads Set example values

Use an ODBC driver from .NET


Driver= {any odbc driver's name} ; OdbcKey1= someValue ; OdbcKey2= someValue ;
See the respective ODBC driver's connection strings options. The .net OdbcConnection will just pass on the connection string to the specified ODBC driver. Read more here .

.NET Framework Data Provider for OLE DB


TYPE USAGE

.NET Framework Wrapper Class Library System.Data.OleDb.OleDbConnection

More info and wrapper class library downloads

http://www.connectionstrings.com/access-2007[18/12/2012 11:37:23 AM]

Access 2007 Connection String Samples - ConnectionStrings.com


MANUFACTURER

Microsoft
Set example values

Use an OLE DB provider from .NET


Provider= any oledb provider's name ; OledbKey1 = someValue ; OledbKey2 = someValue ;
See the respective OLEDB provider's connection strings options. The .net OleDbConnection will just pass on the connection string to the specified OLEDB provider. Read more here .

Copyright 2012 ConnectionStrings.com|All Rights Reserved|Powered by CSAS|Send feedback, articles, requests and more connection strings here.

http://www.connectionstrings.com/access-2007[18/12/2012 11:37:23 AM]

Das könnte Ihnen auch gefallen