Permet de connaitre le mot de passe qui protège une base de donnée Access
Source / Exemple :
'********************************************************************************************
' Name : xGetAccessPwd
' Purpose : Get the password of an MS Access database
' Syntax : xGetAccessPwd(FileName)
' Parameters : FileName : The name (and path) of the Access database
' Return : The password protecting the database
'********************************************************************************************
Function xGetAccessPwd(ByVal FileName As String) As String
Dim intFileID As Integer
Dim strMyChar As String
Dim strTempPwd As String
Dim bytSecretPos As Byte
Dim bytNextChar As Byte
Dim alngSecret(13) As Long
alngSecret(0) = (&H86)
alngSecret(1) = (&HFB)
alngSecret(2) = (&HEC)
alngSecret(3) = (&H37)
alngSecret(4) = (&H5D)
alngSecret(5) = (&H44)
alngSecret(6) = (&H9C)
alngSecret(7) = (&HFA)
alngSecret(8) = (&HC6)
alngSecret(9) = (&H5E)
alngSecret(10) = (&H28)
alngSecret(11) = (&HE6)
alngSecret(12) = (&H13)
bytSecretPos = 0
intFileID = FreeFile
Open FileName For Input As #intFileID ' Open file for input.
For bytNextChar = 67 To 79 Step 1 ' Read in Encrypted Password
Seek #intFileID, bytNextChar ' Set position.
strMyChar = Input(1, #intFileID) ' Read character.
strTempPwd = strTempPwd & Chr(Asc(strMyChar) Xor alngSecret(bytSecretPos)) 'Decrypt using Xor
bytSecretPos = bytSecretPos + 1 ' Increment pointer
Next
Close #intFileID ' Close file.
xGetAccessPwd = strTempPwd
End Function