0% found this document useful (0 votes)
46 views1 page

WinCC SmartTags Script Example

This code connects to a database called "Mayur_Batch_Report" on the server "TESTING-PC\WINCC", queries the "Liquid" table to retrieve records where the "CHEMICAL_NAME" field matches a tag called "LIQUID.CHEMICAL_NAME", and sets the text and index of a combo box control using fields from the returned record.

Uploaded by

PMA PUNE
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views1 page

WinCC SmartTags Script Example

This code connects to a database called "Mayur_Batch_Report" on the server "TESTING-PC\WINCC", queries the "Liquid" table to retrieve records where the "CHEMICAL_NAME" field matches a tag called "LIQUID.CHEMICAL_NAME", and sets the text and index of a combo box control using fields from the returned record.

Uploaded by

PMA PUNE
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

Dim Program_List_Combo

Dim objConnection
Dim strConnectionString
Dim lngValue
Dim RcrdSt
Dim RS
Dim ServerName
ServerName = [Link]("@TESTING-PC\WINCC").Read\WINCC_M

Set objConnection = CreateObject("[Link]")


strConnectionString = "Provider=MSDASQL;Initial Catalog=" &
SmartTags("Mayur_Batch_Report")&";DSN=WINCC_M"
[Link] = strConnectionString
[Link]
Dim cmd
Set cmd = CreateObject("[Link]")
Set RS=CreateObject("[Link]")
With cmd
.ActiveConnection = objConnection
'.CommandText = "SELECT CHEMICAL_NAME FROM Liquid
.CommandText ="SELECT * FROM Liquid WHERE CHEMICAL_NAME = " &
SmartTags("LIQUID.CHEMICAL_NAME")
'.execute
Msgbox ("Cross_Check_Done")
End With
[Link] cmd
Program_List_Combo.Index = [Link]("CHEMICAL_SAP_CODE").Value
Program_List_Combo.Text = [Link]("CHEMICAL_NAME").Value
'Msgbox [Link]("Program_Name").Value
[Link]
''Program_List_Combo.CountVisibleItems = count
[Link]
''ScreenItems("Program_List").selectedindex = 1
End Sub

You might also like