首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

帮忙纠正一下end sub后只能跟注释解决思路

2012-03-09 
帮忙纠正一下end sub后只能跟注释Function function2()Private Declare Sub Sleep Lib kernel32 (ByVal

帮忙纠正一下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()

[解决办法]

探讨
Private Declare Sub Sleep Lib "kernel32 " (ByVal dwMilliseconds As Long)
Function function2()

[解决办法]
把 Private Declare Sub Sleep Lib "kernel32 " (ByVal dwMilliseconds As Long)
放到“通用”的“声明”中去吧

[解决办法]
把API申明放到外面去.
[解决办法]
Public Declare Sub Sleep Lib "kernel32 " (ByVal dwMilliseconds As Long)
放入一个标准模块中去~~~

[解决办法]
放在代码的开头

 declare应该放在任何的sub或者function定义之前
[解决办法]
探讨

放在代码的开头

declare应该放在任何的sub或者function定义之前

热点排行