SoFunction
Updated on 2025-04-14

ASP essence source code collection (five-year summary) page 2/20


Now you can compress a database with passwords, the code is as follows, but the compressed database password is gone! How to solve it?
<%
Const JET_3X = 4
Function CompactDB(dbPath, boolIs97)
Dim fso, Engine, strDBPath
strDBPath = left(dbPath,instrrev(DBPath,"\"))
Set fso = CreateObject("")
If (dbPath) Then
Set Engine = CreateObject("")
If boolIs97 = "True" Then
"Provider=.4.0;Data Source=" & dbpath, _
"Provider=.4.0;Jet OLEDB:Database Password='XXXXXXXX';Data Source=" & strDBPath & ";" _
& "Jet OLEDB:Engine Type=" & JET_3X
Else
"Provider=.4.0;Jet OLEDB:Database Password='XXXXXXXX';Data Source=" & dbpath, _
"Provider=.4.0;Data Source=" & strDBPath & ""
End If
strDBPath & "",dbpath
(strDBPath & "")
Set fso = nothing
Set Engine = nothing
CompactDB = "Your database, " & dbpath & ", has been compressed successfully!" & vbCrLf
Else
CompactDB = "The database name or path is incorrect. Please try again!" & vbCrLf
End If
End Function
%>
Previous page1234567891011121314151617181920Next pageRead the full text