Discussion Locked

VB6 and ADO password protected Databases

0 helpful
14 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I'm trying to access a password protected Access 2000 database and using VB6 with ADO as a front door. Does anyknow how to do this? I have looked high and low and couldn't find the answer. Please Help!!

14 replies

by donq

The Access "on-line-Help" has everything u need if you search "Secruty". Remember ADO allows connection to any database (Oracle, Sybase, DB2, etc.)

You will likely need "Secure a Database using the User-Level Security Wizard" in conjunction witha UNIQUE workgroup on each front-end PC?

The process is involved but works really well!

by rlmack4

Looking to get away from Access workgroups, mainly cause I have found them anything but secure. I do thank you for the quick response.

by tjc

the following link is a ms access password retrival system, since when you open a password protected database you need to know what the password is.

http://www.zdnet.com/downloads/stories/info/0,,57462,.html

(no spaces)

Next when you open the file, just like any other access file you throw the password into the open statement - it's be too long ago for me to remember the open statement.

But check out the online help in VB on it and you should be good to go.

by rlmack4

Well I am trying to write a front door program to access a database. I want to use Visual Basic 6. I thank you for you help and I will look into the open statement.

by rlmack4

Please Note that the database is password protected not accessed by userid and password.

by c1980

You stated that the DB is not accessed by userID and Password. Then, may I ask, how is the Db password protected? If it is password protected Access password assignment, then it can be accessed. We just need to know what the problem is which you are having. (Or is the file its self password protected by another program?)
I use password protected MDBs all the time and have no problems accessing them with the password and userID in the connection. Please post a comment and explain a little more.

PS. Using workgroups as stated in the prev. answer is secure if used right. Most people make the mistake of not changing the rights for the DEFAULT admin - then anyone with a copy of MS Access can access the MDB by changing the Workgroup.....
Because the passwords are stored in the MDB, one can retrieve the password with the right tools, and this is the only hang-up using Workgroups and an MDBs password protection - unless the MDB is encrypted as well.

by rlmack4

Open a database....select tools and then select security....There is a thing called Lock Database. This locks the database so that noone can open the database without a password. Workgroups are NOT secure! Period. If you have a Access database that ppl are accessing from a workgroup, i just have to either delect my workgroup or get on a computer that is on a workgroup and i can access your database as an Admin....been there done that....looked like an ass....To make a story short. I have to use some "tricks" to do this. I have access the database, i think. Just need to figure out what SQL statement to use to access the table inside the database.

by c1980

I had hoped that you would have posted a comment to your question and not to my answer so that I would have a chance to help you with-out getting another rejection.....Please do so and I will continue to try to find a solution to the problem.

Try this:

Set cn = New ADODB.Connection
Dim rs As ADODB.Recordset

cn.Provider = "Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;"
cn.Open ";Data Source=c:\databases\myDB.mdb;Jet OLEDB:Database Password=12345678;"
Set rs = New ADODB.Recordset
rs.Open "SELECT * FROM myTable", cn, adOpenStatic, adLockOptimistic

As to your comment on the Workgroup security - I will say it again: It can be made secure!
You need to change ownership for the database from the default owner of admin AND set up your own admin account, removing permissions from the DEFAULT admin account so changing workgroups or whatever doesn't affect whether the default admin has permissions, and also not making available to users the workgroup that the MDB was created with!
See the TechRep answer on thread 73566 for more detail:

https://www.techrepublic.com/forumqa/thread_detail.jhtml?thread_id=73566

(remove any spaces in the URL)

by c1980

It is still happening(the space).
Again, please remove it. Normally it wouldn't be a problem because the page wouldn't be found and that would through up the red flag, but in this case I keep getting this page here.
Maybe TR will correct it.....

This discussion is closed to new replies.