AnsweredAssumed Answered

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

Question asked by zerenato on May 25, 2017
Latest reply on May 25, 2017 by pmartin

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?

Outcomes