如何在vb.net中从dbf替换nsx文件索引的内容

huangapple go评论77阅读模式
英文:

How to replace the contents of nsx file index from dbf in vb.net

问题

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.
如何使用vb.net从dbf替换索引文件内容?

Thanks

DBF数据库IFG.DBF是主数据项

INDEX DBF数据库IFGX.NSX是主数据项

DBF数据库GSD.DBF是详细销售数据

INDEX DBF数据库GSDX.NSX是详细销售数据

替换前项目:
如何在vb.net中从dbf替换nsx文件索引的内容

替换后项目:
如何在vb.net中从dbf替换nsx文件索引的内容

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("已更新表格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("已更新表格GSD", "", MessageBoxButtons.OK, MessageBoxIcon.Information)
    End Sub
英文:

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

ITEM BEFORE REPLACE:
如何在vb.net中从dbf替换nsx文件索引的内容

ITEM AFTER REPLACE:
如何在vb.net中从dbf替换nsx文件索引的内容

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

答案1

得分: 1

.NSX扩展名用于.DBF文件是一个叫做_HyperSix_的专有Clipper扩展。它不仅使用了不同的文件格式来存储Clipper索引文件(.nsx而不是.cdx),还使用了不同的MEMO格式(.smt),允许备忘录文件的大小达到2GB(在当时)。要使用这些数据库,您需要一个专有的商业ADO提供程序:Apollo ADO.NET数据提供程序

英文:

The .NSX extension for .DBF files was a proprietary Clipper extension called HyperSix. It not only used a different file format for Clipper index files (.nsx instead of .cdx), but also a different MEMO format (.smt) which allowed memo file sizes to up to 2GB in size (at the time).

You require a proprietary commercial ADO provider to work with these databases: Apollo ADO.NET Data Provider

huangapple
  • 本文由 发表于 2023年6月9日 14:42:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/76437828.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定