• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1608
  • Last Modified:

how to "unprotect" access 97 database

I have a access 97 database that is a data source for a second access database.

The second access database has been converted to 2007 format.

The first one wasnt. (oops)


I can not convert the access database to 2007 format while the password is active.

but access 2007 can not "deactivate" the password.

Mind you this isnt the user/password pairs, this is just a single password that the access asks for whenever you connect to the database.

short of trying to uninstall access 2007, installing access 97, then reversing the trend, how to I convert the database?
0
Rance_Hall
Asked:
Rance_Hall
  • 2
  • 2
1 Solution
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
You can use DAO to remove the password:

Function RemoveDBPassword(DBPath as string, CurrentPassword As String)
Dim dbs As dao.Database

Set dbs = dao.OpenDatabase(DBPath, True, False, ";pwd=" & CurrentPassword)

dbs.NewPassword CurrentPassword, ""

dbs.Close
Set dbs = Nothing
End Function

Copy this into a Standard Module in any Access database, then call it like this from the Immediate window:

?RemoveDBPassword("Full path to your db", "YourPassword")


0
 
Rance_HallAuthor Commented:
The above function gave me a compile error:

Expected:=

so I figured that it was the line that set the new password, so I modified the code to be this:

Function RemoveDBPassword(DBPath As String, CurrentPassword As String)
Dim dbs As dao.Database
Dim retval As Variant

Set dbs = dao.OpenDatabase(DBPath, True, False, ";pwd=" & CurrentPassword)

retval = dbs.NewPassword(CurrentPassword, "")

dbs.Close
Set dbs = Nothing
End Function

This doesn't fix the problem, wonder what I missed?  according to the documentation, this is perfect, so im not sure why it doesnt work.
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
While the NewPassword call might return a value, you don't have to catch it ... the code worked perfectly on my machine, however this was on a 2003 database. You might need to run this from a different environment, with a reference set to the DAO 3.5 library, since that's what 97 used.
0
 
Rance_HallAuthor Commented:
Thanks for the hint, I finally got it.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now