Public Sub Dtllog(ByVal logText As String) Dim fso As FileSystemObject Dim fileName As String Dim a As Object Set fso = New FileSystemObject If fso.FolderExists(App.Path & "\log\") Then Set a = fso.OpenTextFile(App.Path & "\log\" & Format(Now, "yyyymmdd_") & "log.log", ForAppending, True) '记录文件在工程的LOG子目录下 Else fso.CreateFolder (App.Path & "\log\") Set a = fso.OpenTextFile(App.Path & "\log\" & Format(Now, "yyyymmdd_") & "log.log", ForAppending, True) '记录文件在工程的LOG子目录下 End If a.WriteLine (logText) '日期时间记录文本 a.Close End Sub'*-----------------------------------------------------------------------------*Call Oplog.Dtllog( Str & vbCrLf) '调用过程记录日志。本文来自CSDN博客,转载请标明出处: http://blog.csdn.net/guanking/archive/2010/03/03/5342651.aspx
简单写个样子,多的自己动手,下班.CREATE trigger myTrig on yourtable for delete as if 时间>'' and 时间<'' insert into 表1 select * from deleted else if 时间>'' and 时间<'' insert into 表2 select * from deleted
'* 单击“工程”,“引用”,然后在“引用”对话框中选中“Microsoft Scripting Runtime”前的复选框,然后单击“确定”。*-----------------------------------------------------------------------------*
'* 注释内容,用于保存详细log文件的方法。使用中。
Public Sub Dtllog(ByVal logText As String)
Dim fso As FileSystemObject
Dim fileName As String
Dim a As Object
Set fso = New FileSystemObject
If fso.FolderExists(App.Path & "\log\") Then
Set a = fso.OpenTextFile(App.Path & "\log\" & Format(Now, "yyyymmdd_") & "log.log", ForAppending, True) '记录文件在工程的LOG子目录下
Else
fso.CreateFolder (App.Path & "\log\")
Set a = fso.OpenTextFile(App.Path & "\log\" & Format(Now, "yyyymmdd_") & "log.log", ForAppending, True) '记录文件在工程的LOG子目录下
End If
a.WriteLine (logText) '日期时间记录文本
a.Close
End Sub'*-----------------------------------------------------------------------------*Call Oplog.Dtllog( Str & vbCrLf) '调用过程记录日志。本文来自CSDN博客,转载请标明出处:
http://blog.csdn.net/guanking/archive/2010/03/03/5342651.aspx
for delete
as
if 时间>'' and 时间<''
insert into 表1 select * from deleted
else if 时间>'' and 时间<''
insert into 表2 select * from deleted