When password is specified in connection string an error will occur while compacting.
Example connection string:
strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=DBNAME.mdb;Jet OLEDB:Database Password=PASSWORD;"
The cause of error is the following function
Function GetForumDB()
dim tmpFileName
tmpFileName = split(strConnstring,"Source=",2,1)
GetForumDB = tmpFileName(1)
end Function
Above function will return the filename as below
DBNAME.mdb;Jet OLEDB:Database Password=PASSWORD
admin_compactdb.asp
Line 60
strForumDB = replace(strForumDB,";","",1,1)
above statement will return render the filename as
DBNAME.mdbJet OLEDB:Database Password=PASSWORD
This will return an error message within the function BackupDB(sFrom) and may be some other errors also.
Changing the Function GetForumDB() as below will fix it
Function GetForumDB()
dim arrConnString, tmpFileName
arrConnString = split(strConnstring, ";")
tmpFileName = split(arrConnString(1), "=")
GetForumDB = tmpFileName(1)
end Function