ADO with DBF (accentuation)

Post Reply
digordo
Posts: 13
Joined: Mon Aug 02, 2010 5:15 pm

ADO with DBF (accentuation)

Post 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
 
digordo
Posts: 13
Joined: Mon Aug 02, 2010 5:15 pm

Re: ADO with DBF (accentuation)

Post 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
User avatar
Kleyber
Posts: 581
Joined: Tue Oct 11, 2005 11:28 am
Location: São Luiz, Brasil

Re: ADO with DBF (accentuation)

Post by Kleyber »

Great!!! Thanks for sharing it.
Kleyber Derick

FWH / xHb / xDevStudio / SQLLIB
Jack
Posts: 249
Joined: Wed Jul 11, 2007 11:06 am

Re: ADO with DBF (accentuation)

Post 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.
digordo
Posts: 13
Joined: Mon Aug 02, 2010 5:15 pm

Re: ADO with DBF (accentuation)

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