Removing database password from acc97 file using acc07?

D

Dick Watson

I'm doing some reverse engineering of copy a legacy Access 97 app I've
stumbled upon. The original developer is moving out of state and the club
needs somebody else to maintain it. I'm the closest thing to a volunteer,
but am totally Acc03/07 in all of my current work.

As noted, this file/application is in Acc97. It has a database password. I
have that password. But almost any amount of analysis/use of tools in Acc07
like the db Documenter requires the file to be at least Acc2k if not later.
So I was going to convert a copy just to do some reverse engineering before
I get too deep in this puddle.

Problem: I can't convert my copy of the database until I remove the
password. But I can't remove the password as the Unset Database Password
command on the tools ribbon is disabled.

How do I get out of this box? Can I do it with Acc03? (Still have one
machine on that.) Acc < 2003?

If I have to find an old CD, I can do that, IIRC, all the way back to Acc97
or earlier. But the potential issues associated with having multiple
versions installed on one of my machines (like Acc97 installed AFTER Acc03)
are worrisome to me. I'm just volunteering here. I don't want to break my
"real work" to help the club out. And they REALLY DON'T want to"break" the
Acc97 app that's "not broken" by any upgrade beyond the museum they are
running.
 
6

'69 Camaro

Hi, Dick.
Problem: I can't convert my copy of the database until I remove the
password. But I can't remove the password as the Unset Database Password
command on the tools ribbon is disabled.

The database password in Access 2007 is a horse of a different color when
compared to Access 97's database password. I suspect you'll need to enable
the Access 97 database before Jet 4.0 or the ACE database engine can work
with the file. You should work with a copy of the file, not the original.
Try the following procedure (replace with your own file path and password):

Public Function removeDBPassword() As Boolean

On Error GoTo ErrHandler

Dim wkSpc As Workspace
Dim db As Database

Set wkSpc = CreateWorkspace("", "Admin", "", dbUseJet)
Set db = wkSpc.OpenDatabase("C:\Work\A97DB.mdb", True, False,
";pwd=MSFT")

db.NewPassword "MSFT", ""

CleanUp:

Set db = Nothing
Set wkSpc = Nothing

Exit Function

ErrHandler:

MsgBox "Error in removeDBPassword( )." & vbCrLf & vbCrLf & _
"Error #" & Err.Number & vbCrLf & vbCrLf & Err.Description
Err.Clear
GoTo CleanUp

End Function

If it doesn't work in Access 2007, then try it with Access 2003. If it
still doesn't work, try using the OpenCurrentDatabase method and include the
database password as the final argument. If you get prompted to either
enable or convert the Access 97 database at that time, enable it. Try it
with either TRUE or FALSE as the second argument. Try it with Access 2003,
and then Access 2007 if that doesn't work.

Once the Access 97 file is enabled, try the code above again to remove the
password.

If none of these suggestions succeed, then you have no choice but to use
Access 97 to open the database exclusively to change the database password.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 
6

'69 Camaro

Correction:

Make that "converted," not "enabled." One cannot make changes to the
designs of objects in an enabled Access 97 database from a later version of
Access, so I would surmise that this goes for database passwords, too.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 
D

Dick Watson

That's kinda what I was beginning to suspect. But that's a Catch-22 since
you have to convert to remove the password but you can't convert if there is
a password.

But your code fragment did the trick. Thanks! Saved me the time to dig into
THAT problem.
 
6

'69 Camaro

Hi, Dick.
But your code fragment did the trick.

Code fragment? It was a full procedure, complete with error handling and
release of system resources, suitable for pasting into a code module in its
entirety. (Okay. I forgot to set the return value, but it was set up so
that there could be one returned by the function with a very short line of
code. It was close to midnight, so I can't say that I can remember
everything I should at that time of day.) But anyway, I'm glad it worked
for you. It did exactly what it was supposed to do. Now you can continue
with the important things.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 
D

Dick Watson

Sorry you took that wrong, I wasn't trying to seem ungrateful and appreciate
the effort that goes into crafting thoughtful replies. Thousands of times
over...
 
6

'69 Camaro

Hi, Dick.
Sorry you took that wrong

Don't worry. I'll get over it very quickly. It's just that most other
people offer snippets of code, whereas I write code and test it before
posting it, expecting readers to be able to copy and paste the procedure
into their own code modules and not have to guess about what other lines of
code are required for the code snippet to work.
appreciate the effort that goes into crafting thoughtful replies.
Thousands of times over...

I know you do. That's why we volunteers try to help as much as we can.
Have a good evening.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 

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