Problems getting accented characters from a dbf file.

Phi1ippe

New member
Joined
May 17, 2013
Messages
1
Programming Experience
10+
I need to read/write a dbf file with accented characters.

The problem is that I need to read french accented characters (?, ?, ...) and '?' gets converted to '?'

I know I have an encoding problem but I don't know how to solve it...

Any help would be greatly appreciated

Here is how I access the dbf file and read it through.

***************************************************************************
connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + _
"C:\ProgramData\Schneider Electric\Vijeo Citect 7.20\User\HRN_CC" + _
";Extended Properties=""dBase IV;"""
'Construction de la requ?te SQL
sqlCmd = "SELECT * FROM digalm WHERE TAG ='CC013TNK253_9TT300A_HH'"
Try
dBaseConnection = New System.Data.OleDb.OleDbConnection(connectionString)
dBaseConnection.Open()

dBaseCommand = New System.Data.OleDb.OleDbCommand(sqlCmd, dBaseConnection)
dBaseDataReader = dBaseCommand.ExecuteReader(CommandBehavior.SequentialAccess)
While dBaseDataReader.Read
MessageBox.Show(dBaseDataReader("DESC").ToString())
End While

dBaseCommand.Dispose()

dBaseConnection.Close()
Catch ex As Exception
valueToReturn = False
End Try
***************************************************************************
 
Back
Top