Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: Database: MS Access
 Code for password protected Access DB?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

mickys
Starting Member

USA
4 Posts

Posted - 18 September 2009 :  08:40:44  Show Profile
I'm using an MS Access database with v3.4.07 and all is fine using the following code.

strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/server.com/path/dbase/database.mdb")

If I decide to password protect the database, how would I change the code to deal with the password?

I tried

strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/server.com/path/dbase/database.mdb;Jet.OLEDB: Database Password=password")

but it proved to be an incorrect approach. Rather than spin the proverbial wheels, I thought I'd ask the experts. I suspect the answer is simple, but unfortunately so am I!

Many thanks...

Micky

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 18 September 2009 :  09:56:17  Show Profile  Visit HuwR's Homepage
http://www.connectionstrings.com/access
Go to Top of Page

mickys
Starting Member

USA
4 Posts

Posted - 18 September 2009 :  10:25:21  Show Profile
Here's what I did -- in case someone finds this thread and needs the solution.

strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=//path/dbase/database.mdb;Jet OLEDB:Database Password=password;"
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 18 September 2009 :  16:47:42  Show Profile  Visit AnonJr's Homepage
With what you tried, you're trying to map the physical path to "/server.com/path/dbase/database.mdb;Jet.OLEDB: Database Password=password" - which isn't a valid directory.

You can use:
strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/server.com/path/dbase/database.mdb") & ";Jet.OLEDB: Database Password=password"
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000 Version 3.4.07