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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Security password on BE doesn't work on FE using VB code

Status
Not open for further replies.

franksirvent

Programmer
Mar 8, 2002
358
GB
Hi there

I read sometime ago that you can set the password on a backend from the front end using code like this:

Private sub Set_password()
Dim dbProtected As Database
Set wrk = DBEngine.Workspaces(0)
Set dbProtected = wrk.opendatabase("c:\mydb\db1.mdb", False, False, ";PWD=XXX")
End Sub

(sorry, but I can't give the credit to the person who posted it as I can't find it !)

I've now found the chance to use it as I need some security on my back end (which is protected with a general password XXX)
The code above runs when it opens the Main Menu form, however it does't seem to work...When I try to do any searches, etc the 'database need password' message comes up.

I have double checked and the password match correctly...also the VB code seems to work correctly, no errors given...

Any ideas ???
 
If you look at my FAQ's in others and forms forums it will give you some ideas. If you have a fiels for the password you can then use dlook function. I use this torestict user to there own data.


Never give up never give in.

There are no short cuts to anything worth doing :)
 
dear assets,

I did check the forum for several hours before I sent my post. I was not able to find what I was after.
I found other ways (using ADO, etc etc) however I am looking for a particular solution to my problem, which is to use the code I posted.

I don't want to use 'dlook' or whatever, I want to use the code posted, which looks like what I am after.

Yes, I also checked your FAQ 181-4888 but that's not what I am looking for. Sorry.

I want to set up passwords on all BE databases, because the problem is that I know for a fact people are copying them. I don't want them to open the tables etc and get the information which they contain. I know they are taking them home and do whatever they want with it.

So my idea is to give it a password and then get the FE .mde application to 'unlock' the BE database by using the code I mentioned...
They cannot make the FE .mde to work on any computer other than the ones I've install them (because of a security system within the MDE) but they can extract the information from the BE tables which are viewable.

I am not sure if it is clear what I am trying to achieve.

Thanks for your input.




 
Dear Assets

note that I found a solution to my problem.
I was complicating my life and trying to create a complicated solution when a simple one was available.
I basically deleted all links to the BE, and relinked all tables again.
Every time I did so, I got asked for the password...
Since I am typing the correct password, the link now has access to the table and 'remembers' the password everytime.

It was that simple however I made it complicated (or didn't understand how to properlydo it...)

thanks for your input and trying to help me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top