DSNless connection to MS Access

Here are some examples of DSNless connections to MS Access - this is highly
recommended over using ODBC


This also assumes you have created a "private" folder in the FTP root for
your account.


Remember to replace your-account-name with your own account
name.



OLE DB Provider for Microsoft Jet For standard security (ie No db password
assigned)


oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=D:HSHomeyour-account-nameprivatedatabase-name.mdb;" & _
"User Id=admin;" & _
"Password="

If using a Workgroup (System Database)

oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=D:HSHomeyour-account-nameprivatedatabase-name.mdb;" & _
"Jet OLEDB:System Database=MySystem.mdw", _
"myUsername", "myPassword"
Note, remember to convert both the MDB and the MDW to the 4.0

database format when using the 4.0 OLE DB Provider.



If MDB has a database password

oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=D:HSHomeyour-account-nameprivatedatabase-name.mdb;" & _

"Jet OLEDB: Database Password=MyDbPassword", _
"myUsername", "myPassword"

If want to open up the MDB exclusively
oConn.Mode = adModeShareExclusive
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=D:HSHomeyour-account-nameprivatedatabase-name.mdb;" & _
"User Id=admin;" & _
"Password="
If MDB is located on a remote machine

- Upgrade to SQL Server and use an IP connection string



If you don't know the path to the MDB

<% ' ASP server-side code
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath(".") & "myDb.mdb;" & _
"User Id=admin;" & _
"Password="
%>
This assumes the MDB is in the same directory where the ASP page is running.
Also make sure this directory has Write permissions for the user account.

 

  • 1 משתמשים שמצאו מאמר זה מועיל
?האם התשובה שקיבלתם הייתה מועילה

מאמרים קשורים

How to Backup your MySQL DB databases

Backup command for mysql databases For those looking to get a regular backup of your MySQL...

How do I create a MySQL database in Cpanel ?

MySQL databases can be created through the cpanel control panel: Login to your control panel...

How do I create a MySQL database in Plesk ?

MySQL databases can be created through the plesk control panel: Login to your control panel...

How do I repair a damaged MySQL table, rebuild index or prepare for backup ?

It is always worth trying a repair of MySQL tables before backing them up to shrink the...

How do I create a MySQL Database in the Ensim control panel ?

To add a database (subject to hosting plan resources available) through your Ensim control panel:...

Powered by WHMCompleteSolution