Page 1 of 1

ADO with DBF (accentuation)

Posted: Thu Apr 17, 2014 1:44 pm
by digordo
hi guys!

I'm use select in a table DBF with ADO, and the accentuation in RecordSet is wrong. Anyone know how to fix?

Code: Select all

Function U_Teste()
Local oConn
Local cSQL
Local rsClaims

oConn:= CreateObject("ADODB.Connection")
oConn:Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\temp\dados;Extended Properties=DBASE IV")

cSQL := "SELECT * FROM SP50001"

rsClaims := CreateObject("ADODB.Recordset")
rsClaims:CursorLocation := 3  // adUseClient
rsClaims:CursorType := 3 // adOpenStatic
rsClaims:ActiveConnection:= oConn
rsClaims:Open(cSQL)

rsClaims:MoveFirst()
MsgStop(rsClaims:Fields("SP5_CODIGO"):Value)    //HERE IS TO SHOW 'MIRIÃ' BUT IS SHOWING 'MIRI+'

Return
 

Re: ADO with DBF (accentuation)

Posted: Thu Apr 17, 2014 6:59 pm
by digordo
I found!

Is just change de register in windows: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\xBase, DataCodePage=OEM to DataCodePage=ANSI


Thanks

Re: ADO with DBF (accentuation)

Posted: Fri Apr 18, 2014 4:32 pm
by Kleyber
Great!!! Thanks for sharing it.

Re: ADO with DBF (accentuation)

Posted: Sun Apr 20, 2014 8:26 am
by Jack
I have the same problem with MS SQL .

It is fine with xharbour and Fivewin 9.11 but with Harbour and Fivewin 2012 not .

What is the register key for Ms SQL .

Thanks.

Re: ADO with DBF (accentuation)

Posted: Fri Apr 25, 2014 12:44 pm
by digordo
Jack, look in the provider string connection, something like charset=ISOXXXX.

Jack wrote:I have the same problem with MS SQL .

It is fine with xharbour and Fivewin 9.11 but with Harbour and Fivewin 2012 not .

What is the register key for Ms SQL .

Thanks.