Hi Gejza,
I'm using modified TDbfDataset's methods (FieldGet(n) and FieldPut(n,x) like
this:
CLASS TDbfDataSet FROM XDbfDataSet
DATA lAnsi INIT .F.
METHOD FieldGet( n )
METHOD FieldPut( n, x )
ENDCLASS
//---------------------------------------------------------- --------------------
METHOD FieldGet( n ) CLASS TDbfDataSet
LOCAL x := ( ::cAlias )->( FieldGet( n ) )
IF !::lAnsi .AND. ValType( x ) $ "CM"
x := TRIM(OemToAnsi( x ))
ENDIF
RETURN x
//---------------------------------------------------------- --------------------
METHOD FieldPut( n, x ) CLASS TDbfDataSet
IF !::lAnsi .AND. ValType( x ) == "C"
( ::cAlias )->( FieldPut( n, AnsiToOem( x ) ) )
ELSE
( ::cAlias )->( FieldPut( n, x ) )
ENDIF
RETURN x
When creating a TDbfDataset from a ANSI-Dbf-file I set oDbfDataset:lAnsi to
..T. otherwise it will be .F. and changing characters of the dabasefields
automatically to ANSI.
Maybe this can help you.
Regards
Ingo
"Gejza Horvath" <
_hsoftkn@nextra.sk> schrieb im Newsbeitrag
news:450e3793$[email=
1@news.xailer.com...]
1@news.xailer.com...[/email]
> Hi,
>
> in my DBF-s are fields coded in OEM character set, but the TDbfDatSource
> opens the files with ANSI coding (default by Windows). I'm looking for
> setting to tell to datasource open the file with OEM coding. I found it
> only in TAdsDataSource, property nCharType. How to do this?
>
>
> Gejza Horvath
> Slovakia
>