Stop start up code

C

CJ

Hi groupies.

I have adopted an A2K3 database that has a ton of code programmed by
somebody much better versed in VB than I am.

When the database opens there is code that executes and makes it so that I
can not see the navigation pane etc. I only know how to cancel code using
Shift and that does not work here.

How can I make it not run at all?
 
C

CJ

Hi Jeff:

What I mean is holding down Shift does not stop the start up code from
running.
 
J

Jeff Boyce

CJ

Are you launching a full copy of the application or an .mde file (or the
Access 2007 equivalent)?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

John Spencer

It sounds as if the developer turned off the ByPass key.

Add this code to a different database and then call it with the name of your
database. It may work depending on how savvy the developer was about
locking up the bypass key.


Public Function ResetExternalDatabaseBypassKey(strPath)
'*******************************************
'Name: ResetExternalDatabaseBypassKey (Function)
'Purpose: Sets AllowByPassKey to true in another Access Database
'Author: John Spencer UMBC-CHPDM
'Date: May 02, 2000, 12:08:19 PM
'Sample Call: ResetExternalDatabaseBypassKey "C:\SomeDirectory\My
Locked.mdb"
'*******************************************
Dim dbs As Database

If Len(strPath) > 0 Then
Set dbs = DBEngine.Workspaces(0).OpenDatabase(strPath)
dbs.Properties("AllowByPassKey") = True
End If
Exit Function

ResetExternalDatabaseBypassKey_ERROR:
Select Case Err.Number
Case 3270 'Property not found
MsgBox "Allow Bypass Key property does not exist for the chosen
database."
Case Else
MsgBox Err.Number & ": " & Err.Description
End Select

End Function


--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
C

CJ

Great, thanks. I will give it a try.

--
Thanks for taking the time!

CJ
---------------------------------------------------------
Know thyself, know thy limits....know thy newsgroups!

John Spencer said:
It sounds as if the developer turned off the ByPass key.

Add this code to a different database and then call it with the name of
your database. It may work depending on how savvy the developer was about
locking up the bypass key.


Public Function ResetExternalDatabaseBypassKey(strPath)
'*******************************************
'Name: ResetExternalDatabaseBypassKey (Function)
'Purpose: Sets AllowByPassKey to true in another Access Database
'Author: John Spencer UMBC-CHPDM
'Date: May 02, 2000, 12:08:19 PM
'Sample Call: ResetExternalDatabaseBypassKey "C:\SomeDirectory\My
Locked.mdb"
'*******************************************
Dim dbs As Database

If Len(strPath) > 0 Then
Set dbs = DBEngine.Workspaces(0).OpenDatabase(strPath)
dbs.Properties("AllowByPassKey") = True
End If
Exit Function

ResetExternalDatabaseBypassKey_ERROR:
Select Case Err.Number
Case 3270 'Property not found
MsgBox "Allow Bypass Key property does not exist for the chosen
database."
Case Else
MsgBox Err.Number & ": " & Err.Description
End Select

End Function


--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
.
 
B

biganthony via AccessMonster.com

Hello John,

Hope you don't mind me butting in! I tried your code and it worked on one of
my databases.

Can I ask a question? In your answer you wrote "It may work depending on how
savvy the developer was about locking up the bypass key." Would you be able
to explain how I could "lockup" the bypas key? I would be interested to know
how to do that as I'm certainly not savvy enough to hide the key!! :)

Many thanks
Anthony
 
J

John Spencer

Use the code, but set the AllowBypass key property to FALSE.

If you want to really lock out the AllowByPassKey property, then see the
following articles
WARNING: Make a copy of your database FIRST so if you have a problem, you
can get back in.

http://www.mvps.org/access/general/gen0040.htm

SetProperties sample code at
http://www.databasedev.co.uk/disable_shift_bypass.html

--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
B

biganthony via AccessMonster.com

Hello John,

thanks for taking time to reply. I had previously secured a database as
explained in the web site you provided (
http://www.databasedev.co.uk/disable_shift_bypass.html) by using a hidden
label to double click and enter a password to allow the bypass and always
thought I had successfully protected it from a moron at work who does not
understand the concept of intellectual property. Your code that you provided
above, will undo this protection.

So, if I implement the code suggested in this website,
http://www.mvps.org/access/general/gen0040.htm, I should be able to keep this
serial pest out of my database?

Looking forward to your reading advice.

Anthony




John said:
Use the code, but set the AllowBypass key property to FALSE.

If you want to really lock out the AllowByPassKey property, then see the
following articles
WARNING: Make a copy of your database FIRST so if you have a problem, you
can get back in.

http://www.mvps.org/access/general/gen0040.htm

SetProperties sample code at
http://www.databasedev.co.uk/disable_shift_bypass.html
Hello John,
[quoted text clipped - 19 lines]
 
J

John Spencer

Well, first thing is to make an mde of your database and only deliver
the mde - that will give you some degree of protection in that the code
behind forms and reports and in modules will be protected. As well as
the structure of the forms and reports. Queries and tables are still
accessible.

Read up on Access user security, then re-read, then read it again.

or if the security of the data is important you might consider switching
to an SQL server for the data store.

I am a long way from being expert in this arena.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

Hello John,

thanks for taking time to reply. I had previously secured a database as
explained in the web site you provided (
http://www.databasedev.co.uk/disable_shift_bypass.html) by using a hidden
label to double click and enter a password to allow the bypass and always
thought I had successfully protected it from a moron at work who does not
understand the concept of intellectual property. Your code that you provided
above, will undo this protection.

So, if I implement the code suggested in this website,
http://www.mvps.org/access/general/gen0040.htm, I should be able to keep this
serial pest out of my database?

Looking forward to your reading advice.

Anthony




John said:
Use the code, but set the AllowBypass key property to FALSE.

If you want to really lock out the AllowByPassKey property, then see the
following articles
WARNING: Make a copy of your database FIRST so if you have a problem, you
can get back in.

http://www.mvps.org/access/general/gen0040.htm

SetProperties sample code at
http://www.databasedev.co.uk/disable_shift_bypass.html
Hello John,
[quoted text clipped - 19 lines]
database. It may work depending on how savvy the developer was about
locking up the bypass key.
 
B

biganthony via AccessMonster.com

Hi John,

That is what I have done (create an mde) - I don't think it ever occurred to
me that you could run the code you gave above on an external database and
reset the bypass shift key - I learn something everyday.

I will read up further on the security.

Many thanks,
Anthony


John said:
Well, first thing is to make an mde of your database and only deliver
the mde - that will give you some degree of protection in that the code
behind forms and reports and in modules will be protected. As well as
the structure of the forms and reports. Queries and tables are still
accessible.

Read up on Access user security, then re-read, then read it again.

or if the security of the data is important you might consider switching
to an SQL server for the data store.

I am a long way from being expert in this arena.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
Hello John,
[quoted text clipped - 31 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top