回复:局域网用OLE-DB Tag and Alarm Export_V8 Excel表读取Wincc归档数据奇怪问题

已锁定

蓝色白开水

  • 帖子

    11
  • 精华

    0
  • 被关注

    1

论坛等级:游侠

注册时间:2020-09-01

普通 普通 如何晋级?

发布于 2021-03-29 16:42:25

1楼

终于求教高人找出了原因,特记录如下,方便后来者:

PCS7 v9.0之后的版本升级更新后,数据库的表结构也发生了变化,原有列向后移了一列

将objRecSet(2)objRecSet(2)objRecSet(3)改为相应的objRecSet(3)objRecSet(3)objRecSet(4)即恢复正常

            If intNumberOfPrimaryColumns <> 0 Then

                If intCurrentID <> C_COUNT Then

                    Sheets(1).Cells(i, intCurrentPosition) = objRecSet(3).Value

                    Sheets(1).Cells(i, intCurrentPosition).NumberFormat = "0.00"

                Else

                    If strInterval = "0" Then

                        Sheets(1).Cells(i, intCurrentPosition) = "1"

                    Else

                        Sheets(1).Cells(i, intCurrentPosition) = objRecSet(3).Value

                    End If

                End If

                'If "Quality" was selected, enter it in the following column (not for "Count")

                If boolQualitySelected = True And intCurrentID <> C_COUNT Then

                    Sheets(1).Cells(i, intCurrentPosition + 1) = Hex$(objRecSet(4).Value)

                End If

            End If


千江有水千江月·万里无云万里天
评论
编辑推荐: 关闭

请填写推广理由:

本版热门话题

DCS/SIMATIC PCS7

共有4375条技术帖

相关推荐

热门标签

相关帖子推荐

guzhang

恭喜,你发布的帖子

评为精华帖!

快扫描右侧二维码晒一晒吧!

再发帖或跟帖交流2条,就能晋升VIP啦!开启更多专属权限!

  • 分享

  • 只看
    楼主

top
您收到0封站内信:
×
×
信息提示
很抱歉!您所访问的页面不存在,或网址发生了变化,请稍后再试。