Link to home
Start Free TrialLog in
Avatar of Didier Duliere
Didier DuliereFlag for Belgium

asked on

error when the .DBF filename have a underscore in a OLEDB SQL Query

Hi experts,

I Must access the .DBF but in the name of the DBF file I’ve “underscore” like : CMSDB_ACT.DBF

But the code don't work with the underscore...

If I remove it, the code work, but I can do that, this is a DBF of a external software.

Can you help me ?

Kind Regards, Didier
Dim sCon As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=H:\Winbooks\Data\CMSDB;Extended Properties=dBASE IV;"
Dim con As New OleDbConnection(sCon)
Dim sql_winbooks As New OleDbCommand("SELECT * FROM CMSDB_ACT.DBF WHERE ISMATCHED = 0", con)
con.Open()
Dim dr_winbooks As OleDbDataReader = sql_winbooks.ExecuteReader

Open in new window

Avatar of sameer2010
sameer2010
Flag of India image

Why are you specifying .DBF in your query? Also, should your data source not have extension?
Avatar of Didier Duliere

ASKER

Yes the data source have the extension

I've try without the extension, and I've the same error message :

The Microsoft Jet database engine could not find the object 'CMSDB_ACT'.  Make sure the object exists and that you spell its name and the path name correctly.
ASKER CERTIFIED SOLUTION
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Many Thanks, that's ok !!!!