I have updated replace items with SQL in the DBF database but the DOS display of the item used in transactions cannot be selected and edited so the solution I have to replace the contents in the NSX file, which is the index of the DBF file. How can I replace index file contents from dbf with vb.net?
Thanks
DBF database IFG.DBF is the master data item
INDEX DBF database IFGX.NSX is the master data item
DBF database GSD.DBF is the detailed sales data
INDEX DBF database GSDX.NSX is the detailed sales data
Private Sub updatepathdbfIFG()
Using cn = New System.Data.OleDb.OleDbConnection(String.Concat("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Path & "; Extended Properties=dBase IV"))
Dim tableDBF = "IFG"
cn.Open()
Using cmd = New OleDbCommand("UPDATE " & tableDBF & " SET " & "ITM=?" & "WHERE ITM=? AND ITC=?", cn)
cmd.Parameters.Add("@ITM", OleDbType.VarChar).Value = TextBoxnewitem.Text
cmd.Parameters.Add("@ITM", OleDbType.VarChar).Value = TextBoxolditem.Text
cmd.Parameters.Add("@ITC", OleDbType.VarChar).Value = TextBoxITC.Text
cmd.ExecuteNonQuery()
End Using
cn.Close()
End Using
MessageBox.Show("updated table IFG", "", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
Private Sub updatepathdbfGSD()
Using cn = New System.Data.OleDb.OleDbConnection(String.Concat("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Path & "; Extended Properties=dBase IV"))
Dim tableDBF = "GSD"
cn.Open()
Using cmd = New OleDbCommand("UPDATE " & tableDBF & " SET " & "ITM=?" & "WHERE ITM=? AND ITC=?", cn))
cmd.Parameters.Add("@ITM", OleDbType.VarChar).Value = TextBoxnewitem.Text
cmd.Parameters.Add("@ITM", OleDbType.VarChar).Value = TextBoxolditem.Text
cmd.Parameters.Add("@ITC", OleDbType.VarChar).Value = TextBoxITC.Text
cmd.ExecuteNonQuery()
End Using
cn.Close()
End Using
MessageBox.Show("updated table GSD", "", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub