Not Reading Password

ca1358
ca1358 used Ask the Experts™
on
It not reading the password on the database, what do I need add.

It stops on this

  DBEngine.CompactDatabase aName, nname & ";pwd= myPass"

Function RepairMDB(aName As String) As Boolean
 
  Dim ws As Workspace
  Dim db As Database
  Dim nname As String
 
  nname = Left(aName, Len(aName) - 3) & "NEW"
   DBEngine.CompactDatabase aName, nname & ";pwd= mypass"
  Kill aName
  Name nname As aName
  RepairMDB = True
 
End Function

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
You're trying to append the password to the destination file name argument (DstName) there. It should be passed in the final argument (SrcLocale). Try changing line 8 above to this:

   DBEngine.CompactDatabase aName, nname, , , ";pwd=mypass"

Author

Commented:
Thank you!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial