Function f_backup_addnew(ym)
vDb=Server.MapPath("../#log#/#log#_"&ym&".mdb")
Set fso = Server.CreateObject("Scripting.FileSystemObject")
if not fso.FileExists(vDb) Then'检测数据库是否存在'
PathLog=Server.Mappath("../#log#") '生成备份目录'
if fso.FolderExists(PathLog)=False then fso.CreateFolder (PathLog)
Set conn3= Server.CreateObject("ADOX.Catalog") '2、生成数据库
conn3.Create "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&vDb
Set conn3 = Server.CreateObject("ADODB.Connection")'3、打开数据库连接
conn3.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&vDb
conn3.execute "Create TABLE xiaofei_log ("&_
"log_id int IDENTITY (1, 1) NOT NULL primary key,"&_
"log_u_id varchar(16) Default='' ,"&_
"log_md_id varchar(5) Default='' ,"&_
"log_xf_dh varchar(26) Default='' ,"&_
"log_xf_mo money Default=0 ,"&_
"log_xf_jf money Default=0 ,"&_
"log_xf_ty varchar(5) Default='' ,"&_
"log_xf_sm varchar(55) Default='' ,"&_
"log_xf_time datetime ,"&_
"log_xf_u_id varchar(16) Default='' ,"&_
"log_xf_u_time datetime "&_
")"
conn3.execute "Create Unique Index iName ON xiaofei_log (log_xf_dh);" '唯一索引'
conn3.close
set conn3=nothing
end if
set f=nothing
set Fso=nothing
End Function
发表评论:
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。