帮忙纠正一下end sub后只能跟注释
Function function2()
Private Declare Sub Sleep Lib "kernel32 " (ByVal dwMilliseconds As Long)
Dim p As Integer
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
cn.Open ("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=独占设备;Data Source=PC-20110915FGKA")
sql = "select * from PROCESS where jczhuangtai=0"
rs.Open sql, cn, 1, 3
rs.MoveFirst
p = 0
Do While rs.EOF = False
cn.Execute "update DCT set zhuangtai=0 where zhuangtai=1"
cn.Execute "update COCT set zhuangtai1=0 where zhuangtai1=1"
cn.Execute "update CHCT set zhuangtai2=0 where zhuangtai2=1"
Adodc8.Recordset.Requery
Adodc9.Recordset.Requery
Adodc14.Recordset.Requery
Sleep 2000
Call function1
Sleep 2000
rs.MoveNext
Loop
End Function
第二句出错了,第二句应该放在哪?请指教下,谢谢!
[解决办法]
Private Declare Sub Sleep Lib "kernel32 " (ByVal dwMilliseconds As Long)
Function function2()
[解决办法]