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

Send Password to VBE from another DB 1

Status
Not open for further replies.

cani

MIS
May 10, 2002
17
0
0
BM
Does anyone know how to send a password to the VBE of another Access Project?

I mistakenly locked the design through the startup properties. I have also disabled the shift bypass. To get around it, I've created a new Access Project and wish to import the forms.

If another method would accomplish the objective of being able to get to the design so that I could make changes, then I would take appreciate that assistance too.

Thanks
 
Use the following code in your new database to disable the shift bypass setting in the original database. (You will need to set a reference to the DAO library.)
Code:
    Dim db As DAO.Database
    Set db = DBEngine.OpenDatabase("path to original database")
    db.Properties.Delete "AllowBypassKey"
    set db = Nothing

(If the original database is secured, you will have to be logged on as the owner or an administrator of that database.)

Rick Sprague
Want the best answers? See faq181-2886
[COLOR=blue]To write a program from scratch, first create the universe.[/color] - Paraphrased from Albert Einstein
 
Thanks, Rick.

I tried the code. I set a reference to DAO 3.6 library.

I received an error message "unrecognizable database format".

I'm assuming because the code is looking for an mdb file format, but the file I need to connect to is an Access Project (adp file format).

I suppose I need code that would connect to an adp an accomplish the same objective.

Assistance would be much appreciated.
 
I still don't know how to do the above, but I did resolve my problem.

If Access is closed while any form control's properies box is open then the next time Access is opened (even if another database) the properties box for a control that has focus will open.

I opened the properties box of a form control in another database. Closed that database with the properties box open. I then opened the database where I was locked out of database design. I used an event property and chose code builder to supply the password to the VBE.

Upon doing that, I entered code that enabled the shiftbypass when the database opened again.

I still wouldn't mind knowing how to use code in case I create a more difficult situation for my self.
 
Sorry, Cani. I didn't realize that DAO can't open an ADP file. I don't know much about the latter. I tried experimenting with the code but didn't know enough to make it work.

I'm glad you solved your problem.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
I would guess some DAO would work, but Microsoft appear to be moving away from DAO in favor of ADO in Access Projects.

Much of the DAO code that I used in my mdb files have had to be replaced with ADO before they would work in my adp files.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top