ADO.NET + OLEDB + dBase + Records Marked For Deletion Question  
Author Message
JohnGalt





PostPosted: .NET Framework Data Access and Storage, ADO.NET + OLEDB + dBase + Records Marked For Deletion Question Top

Hi there everyone,

I'm using ADO.NET and OLEDB to connect to a dbase file that has records marked for deletion in it. When i opened a datareader using the standard connection string found at www.connectionstrings.com the datareader has the records marked for deletion.

That would be fine if I knew how to step over them and not try and access them. I would rather that it didn't return the items that are marked for deletion.

It was my understanding that OLEDB by default skipped records marked for deletion.

So my question is, what am I doing wrong And how do I get OLEDB to either not return items marked for deletion or how do I get my data reader to skip them (continue in my while (dr.Read())

Thanks for your help!



.NET Development9  
 
 
Zlatko Michailov - MSFT





PostPosted: .NET Framework Data Access and Storage, ADO.NET + OLEDB + dBase + Records Marked For Deletion Question Top

I guess that’s a behavior of the OLEDB provider that you are using. You can try a different provider, or an ODBC driver (in which case you’ll have to use the OdbcClient namespace).

If the above is not an option, execute:

SELECT * FROM <your_table>

And see if there is a column on which you can add a WHERE condition.

Zlatko



 
 
Paul P Clement IV





PostPosted: .NET Framework Data Access and Storage, ADO.NET + OLEDB + dBase + Records Marked For Deletion Question Top


What driver or OLEDB provider are you using I don't think I've ever seen this before.

 
 
JohnGalt





PostPosted: .NET Framework Data Access and Storage, ADO.NET + OLEDB + dBase + Records Marked For Deletion Question Top

The OleDB driver for dBase that's part of mdac is what I'm using.

I've gotten around the problem by using the ODBC driver and specifying (by guessing) ;Deleted=Off; at the end of the connection string (the same thing doesn't work on the OleDB driver).

Apparently I could in theory also use the FoxPro driver but I never got that to work.