12/1/2020 11:49 AM | |
Posts: 14 Rating: (0) |
HI I have used WINCC 7.0 in windows 7 and logged my data in SQL SERVER 2008. Now i have updated my OS to windows server r2 2012 and installed wincc v7.4 and sp1 . Now my data are logged automatically in c drive but i cant able to retrieve my data using sql server 2014 . it shows server error 10061. please help me to open my server and retrieve my last year data.and i want to change my storage drive as D drive. Option Explicit Function action Dim strconnectionstring Dim Objconnection Dim objcommand Dim strSQL, Er Dim V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11 Dim V12, V13, V14, V15, V16, V17 Dim DateTimer 'SmartTags("SCRIPT TAGS\TEST_1")= True DateTimer = Now() 'MsgBox DateTimer v1 = HMIRuntime.Tags("M3_Batch").Read v2 = HMIRuntime.Tags("SM3_TC1").Read v3 = HMIRuntime.Tags("SM3_TC2").Read v4 = HMIRuntime.Tags("SM3_TC3").Read v5 = HMIRuntime.Tags("SM3_TC4").Read v6 = HMIRuntime.Tags("SM3_WC1").Read v7 = HMIRuntime.Tags("EM3_DRV_FREQ_ACT").Read v8 = HMIRuntime.Tags("EM3_DRV_HP_ACT").Read v9 = HMIRuntime.Tags("M3_RPM").Read v10 = HMIRuntime.Tags("M3_DRIVE_RUN").Read v11 = HMIRuntime.Tags("M3_PRE_TANK_AGI_ON").Read v12 = HMIRuntime.Tags("M3_PRE_TANK_FEED_ON").Read v13 = HMIRuntime.Tags("M3_CAT_TANK_FEED_ON").Read v14 = HMIRuntime.Tags("M3_Con_Inlet_Sensor").Read v15 = HMIRuntime.Tags("M3_Jacket_Bypass_Drain_Sensor").Read v16 = HMIRuntime.Tags("M3_Jacket_Inlet_Sensor").Read v17 = HMIRuntime.Tags("m3_press").Read 'strconnectionstring = ("Provider=SQLOLEDB; Integrated Security=SSPI;Initial Catalog=PLC;Data Source=HUSSAIN-PC\PLC") strconnectionstring = ("Provider=SQLOLEDB; Integrated Security=SSPI;Initial Catalog=PLC_09072018;Data Source=HUSSAIN-PC") strSQL = "INSERT INTO V1_M3_CustomSeconds(DateTime, Batch, Bottom_T, Vent_T, Condenser_T, Reactor_Jacket_T, Tank_Weight, Freq, Power, Reactor_RPM, Reactor, PE_Mixer, PE_Feedpump, Cat_Pump, M3_Con_Inlet, M3_Jacket_Bypass_Drain, M3_Jacket_Inlet) values (getDate(), m3_press'" & V1 & "','" & V2 & "','" & V3 & "','" & V4 & "','" & V5 & "','" & V6 & "','" & V7 & "', '" & V8 & "', '" & V9 & "','" & V10 & "','" & V11 & "','" & V12 & "','" & V13 & "','" & V14 & "','" & V15 & "','" & V16 & "','" & V17 & "')" Set Objconnection = CreateObject("ADODB.Connection") Objconnection.ConnectionString = strconnectionstring Objconnection.Open Set objcommand = CreateObject("ADODB.Command") Set objcommand.ActiveConnection = Objconnection objcommand.CommandText = strSQL objcommand.execute Set Objconnection = Nothing Set objcommand = Nothing End Function ------------------------------------------------------------------------------------------ |
Last edited by: Jen_Moderator at: 12/01/2020 13:55:23New subject after splitting |
|
Follow us on