Dim Tag,TextList
Tag=SmartTags("_Index")
TextList="TextList1"
Dim conn,oRs,oCom
Set conn = CreateObject("ADODB.Connection")
Set oRs = CreateObject("ADODB.Recordset")
conn.ConnectionString = "Driver={SQL Server};Server=" & HMIRuntime.SmartTags("@ServerName") & "\WINCC;database=" & HMIRuntime.SmartTags("DatabaseName") & ";UID=;PWD=;"
conn.Cursorlocation = 3
conn.Open
Set oRs=CreateObject("ADODB.RecordSet")
Set oCom=CreateObject("ADODB.Command")
Set oCom.activeconnection=conn
oCom.CommandType=1
oCom.CommandText = "SELECT * FROM TextList where TextList = '" & TextList & "'"
Set oRs=oCom.Execute
If Not oRs.EOF Then
Text_Trigger=oRs("Text" & Tag)
End If
oRs.Close
Set oRs = Nothing
Set oCom = Nothing
conn.Close
Set conn = Nothing