help on database password

G

Guest

Hi. We have an old archive database.
Is there a way to open this file?

Im getting a message that i dont have
admin priviledges to access the file

We neet to see on some important records and info
from that database

TIa
 
P

PC User

See if this works.


'Open a Password Protected Access Database
' #Mandix Repository#*****************************************************
' * Programmer Name : FreeVBCode
' * Web Site : http://www.freevbcode.com/ShowCode.Asp?ID=353
' * E-Mail : [email protected]
' * Date : 21/10/1999
' * Time : 09:27
' **********************************************************************
' * Comments : Open a Password Protected Access Database
' *
' *
' **********************************************************************
Public Function OpenPasswordProtectedDatabase(DBPath As String,
Password As String) As Object

'Usage: Open Password protected database
'Parameters: DBPath: Full Path to Access Database
'Password: the Password
'returns the database, in it's open state if successful.
'Otherwise return value will evalute to nothing

On Error Resume Next
Dim db As DAO.Database

Set db = DAO.OpenDatabase(DBPath, False, False, _
";pwd=" & Password)

If Err.Number = 0 Then
Set OpenPasswordProtectedDatabase = db
Else
Set OpenPasswordProtectedDatabase = Nothing
End If

End Function
 
Top