1 Reply Latest reply on May 25, 2017 5:52 PM by pmartin

    How can use SQL Commands to update values in PI Data Archive using PIOLEDB within vb.net ou C

    zerenato

      Hi,

      I try to execute the vb.net code bellow

       

              Dim Cmd As New OleDb.OleDbCommand

              Dim i As Integer

              Dim dr As OleDb.OleDbDataReader

              Dim CmdSQL As String

              Dim CnPI As New OleDb.OleDbConnection

       

              CnPI.ConnectionString = "Provider=PIOLEDB;Data Source=myCollective;Integrated Security=SSPI;Persist Security Info=False;Connect Timeout=2880;Command Timeout = 600000"

              CnPI.Open()

              Cmd.Connection = CnPI

              Cmd.CommandText = "delete FROM piarchive..picomp2 WHERE tag = 'sinusoid'  AND time BETWEEN '2017-01-01 00:00:00' AND '2017-01-02 00:00:00'"

              dr = Cmd.ExecuteReader()

              CnPI.Close()

       

      And the result is

       

        "[PI SDK] Write failed.  Unbuffered write would desynchronize archive data. HIS"

       

       

      Is there any way to use SQL Commands to write data in PI Data Archive?