Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

? about limiting access to Access db while using VB

Status
Not open for further replies.

RichardPrewitt

IS-IT--Management
Apr 16, 2002
57
US
I am making an Access database with a Visual Basic user interface. I am used to putting the db on the server and the program on the PC's but this time I need to put the db on the same PC as the program. My question is, How do you deny access from the user of the PC to the db and still allow the user to make changes to the db through the VB program. I was going to put the db on the C: drive and the VB program on the desktop but I want access to the db on the C drive unaccessable by them clicking on it to open through MS Access. Any help would be much appreciated.
 
Check out the built-in security in access (but be forewarned - it sucks badly!). You can set up a user that has complete access in the security file, then use that user in the program to access the db. And disallow all other users. It's not pretty and when you add tables or links, it's hard to redo the security (at least that's been my experience).

"I think we're all Bozos on this bus!" - Firesign Theatre [jester]
 
It is just for one person. I just want them to edit most of the database using a Visual basic program but not allow them to change other tables. I can already do this through Visual Basics. The thing I want is the database is going to be on the hard drive. You know how you can double-click on a database and it opens it in access. I do not want the user to be able to open the database or access it whithout using the program that I made. With it being on the PC and not the server, I do not know how to deny access to the db without denying access to the db through the VB program.
 
that's the only way i know of to do it. unless the pc is on a network and you can set security. you set up a security file and encrypt the db - so when they try to use it in access w/out the file, they can't do anything.

"I think we're all Bozos on this bus!" - Firesign Theatre [jester]
 
I believe that will work. Is this what you were referring to in your first reply? Either case can you reply with a more detailed description as to how I would go about doing this to the Access db and also how to undo it so I don't lose access to it¿?

Thanks
 
See help for the workgroup file. Every time I've had to do it took me a couple of hours to get it to work - so I don't really want to revist the pain! ;-) As I said before, it is not pretty (IMO) - but it will do the job.

One thing I haven't done with this setup is to access it from a VB pgm - I've always run Access w/ the workgroup file to limit the user's privs.

One other way to do it - use password protection - but i don't know if that will work thru a vb program. this would certainly be easier than the user-level security setup.

"I think we're all Bozos on this bus!" - Firesign Theatre [jester]
 
Ya I can password it through VB, thats why I like putting it on the server cause I can restrict that folder so that user cannot access the db to open it in Access but the program can let them change whatever records according to their password.

My problem is that the db is going to be on their hard drive lol and I need to find someway to make it so they cannot open it in microsoft office but double clicking on it. Making the file a read only wont work because I have to let them edit the records and add records from the VB program. I also need to let them add records to a table that they cannot edit or delete records cause they are company policy procedures. That is the reason why they are having me do it in VB because they were accessing the db directly through Microsoft Office(Access) and changing the policies so that the reports it generated didnt make them have to do certain jobs. I intend to fix that ;)
 
Why don't you just make the DB password protected?

Set QcWs = DBEngine.Workspaces(0)
ConnectStr = ";DATABASE=" & dbPath & "Qdata.mdb ;PWD=rdqa"
Set QcDB = QcWs.OpenDatabase("", False, False, ConnectStr)

The password for this DB is "rdqa"

let me know if this helps
 
ok, im intermediate level in vb and pretty good in access but never had to password protect the db. So where in Access would I put the password code? Not to sound stupid but I've always put the db on a server and restricted access and then passworded the visual basic program. The Visual Basic program does not need to be passworded, I am coding in the security because only one person is using it.
 
Ok, I was able to apply a password to the database through the security settings, but now the Visual Basic program is unable to access and it displays an error message, "Unrecognized database format"

Any help? Greatly appreciate all the support I've recieved so far.

Thanks


 
My understanding is there is just password protection and encryption/decryption. If you choose encryption, it makes the db unreadable. Make sure it's just a password protected (the first option).

"I think we're all Bozos on this bus!" - Firesign Theatre [jester]
 
I'll try the encryption, becuase the password option in the security settings of MS Office Access works like I want it to as for not allowing access to the db itself through Office by the user, but it also does not allow the VB program to access it either. So I'll give the encryption a try, and if it doesnt work then I'll have to find a VB guru to help me change the program to either unencrypt or automatically bypass the password settings. Something along that line.

LOL, I could just deny them write access to their hard drive but it would have the same affect with the vb program as well. LOL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top