本帖最后由 xayle 于 2013-10-5 03:44 编辑
这个看看可不可以, 试试吧
$now = _Now()
$Mssql_Conn = ObjCreate("ADODB.Connection")
$Mssql_Conn.open("Provider=SQLOLEDB.1;Password=123456;Persist Security Info=True;User ID=sa;Initial Catalog=TestDB;Data Source=(Local)\GSQL;")
$Mssql_Conn.CursorLocation = 3
$query = $Mssql_Conn.Execute("SELECT * FROM hy WHERE LoTime < '" & $now & "'")
If Not $query.eof And Not $query.bof Then
$quer2 = $Mssql_Conn.Execute("Update HY set LoTime=GETDATE()+30 WHERE LoTime < '" & $now & "'")
$tmp = $quer2.RecordCount
MsgBox(0,"","本次延期"&$tmp&"会员")
EndIf
$Mssql_Conn.close
$now = _Now()
$Mssql_Conn = ObjCreate("ADODB.Connection")
$Mssql_Conn.open("Provider=SQLOLEDB.1;Password=123456;Persist Security Info=True;User ID=sa;Initial Catalog=TestDB;Data Source=(Local)\GSQL;")
$query = $Mssql_Conn.Execute("SELECT * FROM hy WHERE LoTime < '" & $now & "'")
If Not $query.eof And Not $query.bof Then
$quer2 = $Mssql_Conn.Execute("Update HY set LoTime=GETDATE()+30 WHERE LoTime < '" & $now & "'")
$tmp = $query.GetRows()
MsgBox(0,"","本次延期"&UBound($tmp)&"会员")
EndIf
$Mssql_Conn.close
|