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.
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.