Connecting WinCC Flexible to SQL Server

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?
 

Similar Topics

Hello, I'm Alex from Spain (sorry for my bad english). Firstly, I'm a newbie at Siemens PLCs and HMI, I have been reading this forum for hours...
Replies
2
Views
1,590
Hi Guys! I have two S7-300 PLCs which are redundant using Siemens Software Redundancy and I need to monitor the data of those PLCs in one HMI...
Replies
2
Views
2,165
I have a PLC project. In the same project I have a touch panel 177B. I can simulate the PLC in PLCSIM and start the runtime simulator but they...
Replies
1
Views
7,140
Hi, i am beginner with WinCC and i need help, i connected the Temperature transmitter with a SM331 module on PLC so i can read a temperature value...
Replies
8
Views
4,081
I am upgrading an old version wincc to V7. I want to use AS511 communication. Can I communicate 2 S5-135u cpu's to my WINCC SCADA runtime using...
Replies
0
Views
2,012
Back
Top Bottom