Prince
Member
- Join Date
- Jun 2002
- Posts
- 284
I'm trying to connect Wincc Flexible 2008 Advanced into SQL Server 2005 via script. For the test I made a db in the SQL as db_kalup and created a table with two float fields T1, T2. I made a connection wsith the name PIS and I'm executing this script on button click.
Dim strConnectionString, conn, comm, rec, str1, str2, strSQL
Const t1 = 10.01
Const t2 = 2.01
strConnectionString = "Provider=MSDASQL;DSN=PIS;Trusted_Connection=true;UID=aak2;PWD=p5I4s6;database=db_kalup"
Set conn = CreateObject("ADODB.connection")
Set rec = CreateObject("ADODB.Recordset")
Set comm = CreateObject("ADODB.Command")
conn.ConnectionString = strConnectionString
conn.Open strConnectionString
strSQL = "INSERT IGNORE INTO Test (T1,T2) Values (t1,t2)"
With comm
.ActiveConnection = conn
.CommandText = strSQL
End With
comm.Execute
Set comm = Nothing
conn.Close
Set conn = Nothing
I still do not see values transferred to the table. Am I doing this right?
Dim strConnectionString, conn, comm, rec, str1, str2, strSQL
Const t1 = 10.01
Const t2 = 2.01
strConnectionString = "Provider=MSDASQL;DSN=PIS;Trusted_Connection=true;UID=aak2;PWD=p5I4s6;database=db_kalup"
Set conn = CreateObject("ADODB.connection")
Set rec = CreateObject("ADODB.Recordset")
Set comm = CreateObject("ADODB.Command")
conn.ConnectionString = strConnectionString
conn.Open strConnectionString
strSQL = "INSERT IGNORE INTO Test (T1,T2) Values (t1,t2)"
With comm
.ActiveConnection = conn
.CommandText = strSQL
End With
comm.Execute
Set comm = Nothing
conn.Close
Set conn = Nothing
I still do not see values transferred to the table. Am I doing this right?