Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

Attempted to read or write protected memory. This is often an indication that other memory is corrupt reading DbaseIV tables

$
0
0

I get this error regularly when opening dbase4 tables, as do our customers in the distributed release. We have an old VB6 piece of software that writes data in Dbase4, and we then import those files into the sql database (they are tiny). It works about half of the time.....

Calls stack   

>System.Data.dll!System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(System.Data.OleDb.tagDBPARAMS dbParams, out object executeResult) Line 795C#
System.Data.dll!System.Data.OleDb.OleDbCommand.ExecuteCommandText(out object executeResult) Line 759C#
System.Data.dll!System.Data.OleDb.OleDbCommand.ExecuteCommand(System.Data.CommandBehavior behavior, out object executeResult) Line 725C#
System.Data.dll!System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(System.Data.CommandBehavior behavior, string method) Line 714C#
System.Data.dll!System.Data.OleDb.OleDbCommand.ExecuteReader(System.Data.CommandBehavior behavior) Line 568C#
PrismNG.exe!Prism_Next_Gen.Update_bas.ImportDBaseTable(System.Data.SqlClient.SqlConnection targetConn, System.Data.SqlClient.SqlTransaction targetTran, String tablename, String ConnectionString, System.Windows.Forms.ProgressBar TableProgress) Line 1029Basic

code that errors is below

we are using this connection string

ConnectionString"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\DBASE4\;Extended Properties=dBase IV"

  Using dBaseConnection As New OleDbConnection(ConnectionString)

            dBaseConnection.Open()

            Dim dBaseCommand As New System.Data.OleDb.OleDbCommand("SELECT * FROM " + tablename, dBaseConnection)
            Dim dBaseCommand1 As New System.Data.OleDb.OleDbCommand("SELECT COUNT(*) FROM " + tablename, dBaseConnection)
            dBaseCommand1.CommandType = CommandType.Text


            Dim dBaseDataReader As System.Data.OleDb.OleDbDataReader

            
            Try
        THIS LINE ERRORS
                    dBaseDataReader = dBaseCommand.ExecuteReader(CommandBehavior.SequentialAccess)

pic below...


and when stepped into .net code.... hopefully you have some ideas


Viewing all articles
Browse latest Browse all 8156

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>