Index Not Found Error with DBF files

karnalta

New member
Joined
May 18, 2007
Messages
2
Programming Experience
3-5
Hi,

I have a problem, I try to resolve it since several days, but I can't !

I am reading DBF files with my application and all work fine while I am not trying to do a case 'WHERE' on the first field of the DBF file. I can do a SELECT on it, but not a WHERE. When I try, I got a error saying "Index not found".

Sample :

If [firstField] is the first field of the DBF file :

SELECT [firstField] FROM aDBF WHERE [aField]='blabla' => Work fine
SELECT [aField] FROM aDBF WHERE [firstField]='blabla' => Index not found

Here is the code I use to connect to my DBF file :

-----------------------------------------------------
Imports System.Data.OleDB

Dim dbfConnexion As New OleDbConnection()
dbfConnexion.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\DBF\;Extended Properties=dBASE IV"
dbfConnexion.Open()

Dim oleCommande As New OleDbCommand("SELECT ....", dbfConnexion)
Dim oleReader As OleDbDataReader = oleCommande.ExecuteReader()
oleReader.Read()
...

dbfConnexion.Close()
-----------------------------------------------------

I really need to make it work, so I hope someone wil lbe able to help me !

Thank a lot !

Dimitri.
 
Remember that DBF files have what I concider to be old rules. For instances
no underscores in the field names and tables names less than 8 or 10
bytes.
 
The first field is exactly LV_NUMMER and it's not working, but a working fields is by exemple, LV_KORT.

So if it work with field name LV_KORT I suppose it should work with LV_NUMMER.
 
Back
Top