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
相关文档:
连接ACCESS数据库的简单JSP代码:
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<%@ page import="java.sql.*" %>
<%
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;
String url="jdbc:odbc:Driver={MicroSoft Access Drive ......
GridView 为动态绑定 DataSet,结果 (DataSet)dt = grid1.DataSource 拿不到东西,想偷懒直接添加行不行了, 只好用最笨的办法,把GridView的东西倒成DataSet,然后在DataSet里加行,最后回绑gridview
try里面的
DataTable dtable = new DataTable("tb1");
&n ......
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) ......
1.UpLoadClass.asp
<%
Class UpLoadClass
Private p_MaxSize,p_FileType,p_SavePath,p_AutoSave,p_Error
Private objForm,binForm,binItem,strDate,lngTime
Public FormItem,FileItem
Public Property Get Version
Version=""
End Property
......