Link to home
Start Free TrialLog in
Avatar of Regie Velasco
Regie Velasco

asked on

sql query via vfp

i have sql table with field named arabdes with type nvarchar (100) and with arabic letter entries, i'm trying to retrieve via visual foxpro, but i keep getting ????? instead of the data itself, and the field type on my query is only character and not varchar, can anyone help me with to correctly retrieve this information correctly, thanks in advance
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Visual FoxPro does not process Unicode (nvarchar) strings without explicit conversion obviously.
What Code Page do you use in VFP?
Are you able to display/enter such characters directly in VFP?
What ODBC driver do you use?

If you would like to obtain the data without any conversion then you may issue the following query:
SELECT arabdes, CAST(arabdes AS varbinary(200)) arabdesCNV FROM YourTable

And the arabdesCNV column will create a memo field which will contain Unicode text. Depending on FoxPro Code Page used you'll be able to display the memo after conversion or not... The best function for conversion is STRCONV() or possibly also CPCONVERT().

Unicode characters is possible to print via new report engine with your own Report listener and/or display in 3rd party OLE controls. Everything is rather complex...

More about Unicode in VFP is here:
All VFP International features are described e.g. here:
Avatar of Regie Velasco
Regie Velasco


Thanks a bunch for the suggestion, will try to work on it and reply for result
Avatar of Olaf Doschke
Olaf Doschke
Flag of Germany image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The Arabic characters should be displayed correctly when the VFP Code Page is set to 1256 and the Windows language for Non-Unicode programs is set to Arabic (available in Regional settings).
Thanks pcelba for the code page settings, been searching it on google for a while and ur my answered prayer
Thanks a bunch olaf, will try it as well
Got my problem solved guys, thanks a lot for the help, you guys are awesome