Use the following code:<br><br>Option Compare Binary<br>Option Explicit<br><br>'Attribute VB_Name = "basDatabasePassword"<br>'--------------------------------------------------<br>' basDatabasePassword<br>'<br>' Get the database password of a Jet 3.0/3.5 database.<br>'<br>' --------------------------<br>' This code is provided for the express purpose of destorying the burgeoning<br>' shareware industry of Jet 3.x/3.5x database password crackers. You should<br>' keep in mind that it is still quite illegal to break into a database you have<br>' no authorization to view. Please don't do anything that would cause me to<br>' have less respect for you than for the lifeless souls who try to charge money<br>' for code of this nature on a "per database" basis.<br>'<br>' THIS DOES NOT WORK FOR AN ACCESS 2000 DATABASE OR JET 4.0+.<br>'<br>' TO USE:<br>' 1) Create a new module in any VBA host like Access, Excel, or Visual Basic<br>' 2) Hit <Ctrl+G> to get to the debug window<br>' 3) Run the following line of code in the debug window (replacing c:\foo.mdb with<br>' the full path/name to your database:<br>'<br>' ? StPasswordOfStDatabase("c:\foo.mdb"

<br>'<br>' The function will return the Database Password to you.<br>'<br>' --------------------------<br>' Sample code to allow you to prove to yourself that the function<br>' works (the following code can be run from the debug window).<br>' Change the password from 01234567890123456789 to any<br>' arbitrary value 1-20 characters in length:<br>'<br>' Set dbe = CreateObject("dao.dbengine.35"

<br>' Set db = dbe.CreateDatabase("c:\temp35.mdb", ";LANGID=0x0409;CP=1252;COUNTRY=0"

<br>' db.NewPassword "", "01234567890123456789"<br>' db.Close: Set db = Nothing: Set dbe = Nothing<br>' Debug.Print StPasswordOfStDatabase("c:\temp35.mdb"

<br>' --------------------------<br>'<br>' (c) 1998 Trigeminal Software, Inc. All Rights Reserved<br>'--------------------------------------------------<br><br>Public Function StPasswordOfStDatabase(stDatabase As String) As String<br> Dim hFile As Integer<br> Dim ich As Integer<br> Dim stBuffer As String<br> Dim rgbytRaw() As Byte<br> Dim rgbytPassword() As Byte<br> Dim rgbytNoPassword() As Byte<br> <br> ' Create the byte array with the 20 bytes that are present when there<br> ' is no database password<br> rgbytNoPassword = ChrB(134) & ChrB(251) & ChrB(236) & ChrB(55) & ChrB(93) & _<br> ChrB(68) & ChrB(156) & ChrB(250) & ChrB(198) & ChrB(94) & _<br> ChrB(40) & ChrB(230) & ChrB(19) & ChrB(182) & ChrB(138) & _<br> ChrB(96) & ChrB(84) & ChrB(148) & ChrB(123) & ChrB(54)<br> <br> ' Grab the 20 bytes from the real file whose password<br> ' we are supposed to retrieve<br> hFile = FreeFile<br> Open stDatabase For Binary As #hFile<br> Seek #hFile, 66 + 1<br> rgbytRaw = InputB(20, #hFile)<br> Close #hFile<br> <br> ' Enough prep, lets get the password now.<br> ReDim rgbytPassword(0 To 19)<br> For ich = 0 To 19<br> rgbytPassword(ich) = rgbytRaw(ich) Xor rgbytNoPassword(ich)<br> Next ich<br><br> ' Add a trailing Null so one will always be found, even if the password is 20<br> ' characters. Then grab up to the first null we find and return the password<br> stBuffer = StrConv(rgbytPassword, vbUnicode) & vbNullChar<br> StPasswordOfStDatabase = Left$(stBuffer, InStr(1, stBuffer, vbNullChar, vbBinaryCompare) - 1)<br>End Function<br><br>Mike