使用SQL无源连接,须先点 工程 菜单 选择 引用 然后勾选Microsoft ActiveX Data Objects 2.8 Library和Microsoft ActiveX Data Objects Recordset 2.8 Library
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim sql As String
Dim c As Integer
Dim d As Integer
Dim b As String
Private Sub Form_Load()
db.Open "Provider=SQLOLEDB.1;Password=123;Persist Security Info=True;User ID=sa;Initial
Catalog=DATABASENAME;Data Source=192.172.0.2"
End Sub
Private Sub Timer1_Timer()
c = c + 1
If c Mod 60 = 0 Then
d = d + 1
rs.Open "update mes_sn set fnextterminalid=1098 where fworkorderno='m3112039405' and fnextterminalid=1097 and
fcurrentterminalid=1099",db
b = Str(d)
Label1.Caption = "已经执行第" + b + "次"
End If
End Sub
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。