Home page
 
 Home 
 ASP 
 PHP 
 SQL 
 HTML 
 JavaScript 
 Search 
 Contact 
 
Search
or browse popular tags
ASP Tutorial
Subscription

Sign up for the free email newsletter for new tips, tutorials and more. Enter your email address below, and then click the button.

Privacy Policy

RSS Twitter

MS Access Connection Strings

Print

ODBC Connection Strings

 Standard Security:

<%
'declare the variable that will hold the connection string
Dim ConnectionString 
'define connection string, specify database driver and location of the database
ConnectionString="Driver={MicrosoftAccessDriver(*.mdb)};" &_
"DBQ=C:\your_database_name.mdb;Uid=your_username;Pwd=;"
%>

 Workgroup:

<%
'declare the variable that will hold the connection string
Dim ConnectionString 
'define connection string, specify database driver and location of the database
ConnectionString="Driver={Microsoft Access Driver (*.mdb)}; Dbq=c:\your_database_name.mdb;" &_
"SystemDB=C:\your_database_name.mdw;"
%>

 Exclusive:

<%
'declare the variable that will hold the connection string
Dim ConnectionString 
'define connection string, specify database driver and location of the database
ConnectionString="Driver={Microsoft Access Driver (*.mdb)}; DBQ=c:\your_database_name.mdb;" &_
"Exclusive=1; Uid=your_username; Pwd=;"
%>

OLE DB and OleDbConnection (.NET framework) Connection Strings

 Standard Security:

<%
'declare the variable that will hold the connection string
Dim ConnectionString 
'define connection string, specify database driver and location of the database
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\your_database_name.mdb;" &_
"User Id=admin; Password=;"
%>

 Workgroup (System Database):

<%
'declare the variable that will hold the connection string
Dim ConnectionString 
'define connection string, specify database driver and location of the database
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\your_database_name.mdb;" &_
"Jet OLEDB:System Database=c:\system.mdw;"
%>

 Password protected Access database:

<%
'declare the variable that will hold the connection string
Dim ConnectionString 
'define connection string, specify database driver and location of the database
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\your_database_name.mdb;" &_
"Jet OLEDB:Database Password=your_password;"
%>

 Access database located on a network share:

<%
'declare the variable that will hold the connection string
Dim ConnectionString 
'define connection string, specify database driver and location of the database
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;" &_
"Data Source=\\server_name\share_name\share_path\your_database_name.mdb"
%>

 Access database located on a remote server::

<%
'declare the variable that will hold the connection string
Dim ConnectionString 
'define connection string, specify database driver and location of the database
ConnectionString="Provider=MS Remote; Remote Server=http://your_remote_server_ip;" &_
"Remote Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\your_database_name.mdb"
%>
'


Tags:

Add To: Add to dzone dzone | Digg this digg | Add to del.icio.us del.icio.us | Stumble it stumbleupon

  • Comments





Copyright © 2005-2014             www.WebCheatSheet.com All Rights Reserved.