如何建立WINCCC和数据库的连接

已锁定

小小强

  • 帖子

    71
  • 精华

    0
  • 被关注

    0

论坛等级:游民

注册时间:2006-07-14

普通 普通 如何晋级?

如何建立WINCCC和数据库的连接

706

4

2006-07-14 13:15:23

请问如何建立WINCC和ORACLE ,SQL的连接
帮助里的例子是连接ACCESS的,过程如下:
1. Create the Access database with the WINCC_DATA table and columns (ID, TagValue) with the ID as the Auto Value.

2. Set up the ODBC data source with the name "SampleDSN", reference to the above Access database.

3. Programming.

Example 1

'VBS108

Dim objConnection

Dim strConnectionString

Dim lngValue

Dim strSQL

Dim objCommand

strConnectionString = "Provider=MSDASQL;DSN=SampleDSN;UID=;PWD=;"

lngValue = HMIRuntime.Tags("Tag1").Read

strSQL = "INSERT INTO WINCC_DATA (TagValue) VALUES (" & lngValue & ");"

Set objConnection = CreateObject("ADODB.Connection")

objConnection.ConnectionString = strConnectionString

objConnection.Open

Set objCommand = CreateObject("ADODB.Command")

With objCommand

objCommand.ActiveConnection = objConnection

objCommand.CommandText = strSQL

End With

objCommand.Execute

Set objCommand = Nothing

objConnection.Close

Set objConnection = Nothing

换成SQL时连接的参数变为:
"[Provider=provider;]DRIVER=driver; SERVER=server;

DATABASE=database; UID=user; PWD=password"

请问参数如何配置,在编写代码之前应在SQL如何设置,参数如何对应填写

希望斑竹和高手们能给出详细的过程,谢谢




如何建立WINCCC和数据库的连接 已锁定
编辑推荐: 关闭

请填写推广理由:

本版热门话题

SIMATIC WinCC / Panel

共有32566条技术帖

相关推荐

热门标签

相关帖子推荐

guzhang

恭喜,你发布的帖子

评为精华帖!

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

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

  • 分享

  • 只看
    楼主

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