Data Compression, backup, restoration, download, and deletion of ACCESS databases

Source: Internet
Author: User
Data Compression, backup, restoration, download, and deletion of ACCESS databases

Data Compression, backup, restoration, download, and deletion of ACCESS databases

The Code is as follows:




Database Management



Database Management System








<%
Dim ZC_DATABASE_PATH
'Database path
ZC_DATABASE_PATH = "database/data. mdb"


Data_array = Split (ZC_DATABASE_PATH ,"/")


Dim action
Action = trim (request ("action "))
Dim dbpath, bkfolder, bkdbname, fso, fso1

Select Case action
Case ""
Call chushihua ()
Case "CompressData" ': compressing data
Dim tmprs
Dim allarticle
Dim Maxid
Dim topic, username, dateandtime, body
Call CompressData ()
Case "BackupData" 'Back Up data
If request ("act") = "Backup" Then
Call updata ()
Else
Call BackupData ()
End If
Case "RestoreData" 'restore Data
Dim backpath
If request ("act") = "Restore" Then
Dbpath = request. form ("Dbpath ")
Backpath = request. form ("backpath ")
If dbpath = "" Then
Response. write "Please input your database whole Name"
Else
Dbpath = server. mappath (Dbpath)
End If
Backpath = server. mappath (backpath)

Set Fso = server. CreateObject ("scripting. filesystemobject ")
If fso. fileexists (dbpath) Then
Fso. copyfile Dbpath, Backpath
Response. write "the database is restored successfully!
"
Else
Response. write "the database you need is not found! "
End If
Else
Call RestoreData ()
End If
Case "SpaceSize" 'system space usage
Call SpaceSize ()
Case "deletebackup"
Dim dbname
Dbpath = Request. QueryString ("dbpath ")
Dbname = Request. QueryString ("dbname ")
Dbpath = Server. MapPath (dbpath)
Dbpath = dbpath & "\" & dbname
Set fso = CreateObject ("Scripting. FileSystemObject ")
If fso. FileExists (dbPath) Then
Fso. DeleteFile (DBPath)
Set fso = nothing
Response. write"
The database you backed up has been "& dbpath &" deleted!

Return .."
Else
Response. write dbpath
Response. write"
The entered path is incorrect. Please confirm and enter it again!

Return .."
End If
Case Else
End Select

%>


<%
Response. write""

Sub chushihua ()
%>




<% End sub %>

<%
'================================ System space usage ======================== ========
Sub SpaceSize ()
On Error Resume Next
%>



View system space











Return...


<%
End Sub
%>
<% Sub ShowSpaceInfo (drvpath)
Dim fso, d, size, showsize
Set fso = server. CreateObject ("scripting. filesystemobject ")
Drvpath = server. mappath (drvpath)
Set d = fso. getfolder (drvpath)
Size = d. size
Showsize = size & "Byte"
If size & gt; 1024 Then
Size = (Size/1024)
Showsize = size & "KB"
End If
If size & gt; 1024 Then
Size = (size/1024)
Showsize = formatnumber (size, 2) & "MB"
End If
If size & gt; 1024 Then
Size = (size/1024)
Showsize = formatnumber (size, 2) & "GB"
End If
Response. write "" & showsize &""
End Sub
%>
<%
Sub RestoreData ()
%>




<...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.