asp Access数据备份,还原,压缩类
<!--#include file="config.asp" -->
<!--#include file="Fun.asp" -->
<%
'数据库管理类
class Datas
'备份
public sub Bk()
Set fso=server.createobject("scripting.filesystemobject")
fso.CopyFile Server.MapPath(SiteDataPath),Server.MapPath(SiteDataBakPath)
set fso=nothing
response.Write("<mce:script language=javascript><!--
alert('备份成功!');window.location.href='DataManage.asp'
// --></mce:script>")
end sub
'还原
public sub Rt()
SDPath = server.mappath(SiteDataPath)
SDBPath = server.mappath(SiteDataBakPath)
set Fso=Server.CreateObject("Scripting.FileSystemObject")
if Fso.FileExists(SDBPath) then
Fso.CopyFile SDBPath,SDPath
Set Fso=nothing
response.Write("<mce:script language=javascript><!--
alert('成功:你已经成功恢复数据库!');window.location.href='DataManage.asp?action=rt'
// --></mce:script>")
else
response.Write("<mce:script language=javascript><!--
alert('失败:请检查路径和数据库名是否存在');window.location.href='DataManage.asp?action=rt'
// --></mce:script>")
end if
end sub
'压缩
public sub Dc()
SDBPath = server.mappath(SiteDataBakPath)
set Fso=Server.CreateObject("Scripting.FileSystemObject")
if Fso.FileExists(SDBPath) then
Set Engine =Server.CreateObject("JRO.JetEngine")
if request("boolIs") = "97" then
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & SDBPath, _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & SDBPath & "_temp.mdb;" _
& "Jet OLEDB:Engine Type=" & JET_3X
else
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & SDBPath, _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & SDBPath & "_temp.mdb"
end if
Fso.Copy
相关文档:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
if request("action")=1 then
Response.ContentType="application/ms-excel"
Response.AddHeader "content-disposition","attachment;filename=www.xls"
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//E ......
VISTA+IIS+ASP架站
1. VISTA裝IIS
1-1. 控制面板中“程序和功能”的位 ......
1.放注入函数
sub aspsql()
SQL_injdata = "'|;|and|exec|insert|select|delete|update|count|*|%|chr|mid|master|truncate|char|declare"
SQL_inj = split(SQL_Injdata,"|")
If Request.Form<>"" Then
For Each Sql_Post In Request.Form
For SQL_Data=0 To Ubound(SQL_inj)
if instr(Request.Form(Sql_Post) ......
<%
'asp多风格分页类
'使用范例
'==========================================================================
'Set test = New Page '创建啦
'test.CurrentPage=1 '自己去读取拉,当前的页数
'test.temp="{N1}{N2}{N3} {N4}"'这里是显示的模版,自己可以定义,至于标签,可以自己去那个类里找
'test.Exec "S ......
在设计access数据库时,表中字段属性有id项设为自动编号类型的,添加许多记录后,在该表中将所有记录删除,再新增记录并不会从1开始,如何操作可以使新增记录编号重新从1计数?
解决方法:删除表里所有数据 然后压缩修复数据库 再新增就从1编号了
注:
2000-2003压缩修复数据库点击:工具 ......