您现在所在的是:

西门子SIEMENS

回帖:0个,阅读:640 [上一页] [1] [下一页]
1293
qfcctppq
文章数:122
年度积分:50
历史总积分:1293
注册时间:2006/5/24
发站内信
发表于:2006/7/25 16:27:00
#0楼
Dim strcn,cn
Dim strSQL
Dim NUM,DB1_DBW1,DB1_DBW2,DB1_DBW3,DB1_DBW4,DB1_DBW5,DB1_DBW6,DB1_DBW7,DB1_DBW8,DB1_DBW9,DB1_DBW10
strcn = "PROVIDER=MSDASQL;dsn=sqlserver;uid=;pwd=;database=FJDB;"
Set cn = CreateObject("ADODB.Connection")
cn.ConnectionString = strcn
cn.Open
NUM = HMIRuntime.Tags("NUM").Read
DB1_DBW1 = HMIRuntime.Tags("DB1_DBW1").Read
DB1_DBW2 = HMIRuntime.Tags("DB1_DBW2").Read
DB1_DBW3 = HMIRuntime.Tags("DB1_DBW3").Read
DB1_DBW4 = HMIRuntime.Tags("DB1_DBW4").Read
DB1_DBW5 = HMIRuntime.Tags("DB1_DBW5").Read
DB1_DBW6 = HMIRuntime.Tags("DB1_DBW6").Read
DB1_DBW7 = HMIRuntime.Tags("DB1_DBW7").Read
DB1_DBW8 = HMIRuntime.Tags("DB1_DBW8").Read
DB1_DBW9 = HMIRuntime.Tags("DB1_DBW9").Read
DB1_DBW10 = HMIRuntime.Tags("DB1_DBW10").Read
strSQL = "select NO,NAME1,NAME2,NAME3,NAME4,NAME5,NAME6,NAME7,NAME8,NAME9,NAME10 from FJTB where(NO = 1)"
cn.Execute strSQL
cn.close
NUM = NO
DB1_DBW1 = NAME1
DB1_DBW2 = NAME2
DB1_DBW3 = NAME3
DB1_DBW4 = NAME4
DB1_DBW5 = NAME5
DB1_DBW6 = NAME6
DB1_DBW7 = NAME7
DB1_DBW8 = NAME8
DB1_DBW9 = NAME9
DB1_DBW10 = NAME10
HMIRuntime.Tags("NUM").Write NUM
HMIRuntime.Tags("DB1_DBW1").Write DB1_DBW1
HMIRuntime.Tags("DB1_DBW2").Write DB1_DBW2
HMIRuntime.Tags("DB1_DBW3").Write DB1_DBW3
HMIRuntime.Tags("DB1_DBW4").Write DB1_DBW4
HMIRuntime.Tags("DB1_DBW5").Write DB1_DBW5
HMIRuntime.Tags("DB1_DBW6").Write DB1_DBW6
HMIRuntime.Tags("DB1_DBW7").Write DB1_DBW7
HMIRuntime.Tags("DB1_DBW8").Write DB1_DBW8
HMIRuntime.Tags("DB1_DBW9").Write DB1_DBW9
HMIRuntime.Tags("DB1_DBW10").Write DB1_DBW10

关于我们 | 联系我们 | 广告服务 | 本站动态 | 友情链接 | 法律声明 | 非法和不良信息举报

工控网客服热线:0755-86369299
版权所有 工控网 Copyright©2025 Gkong.com, All Rights Reserved

15.6001