We help IT Professionals succeed at work.

sql query via vfp

117 Views
Last Modified: 2019-03-17
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
Comment
Watch Question

CERTIFIED EXPERT

Commented:
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: https://www.west-wind.com/presentations/foxunicode/foxunicode.html
All VFP International features are described e.g. here: http://stevenblack.com/intl-vfp/

Author

Commented:
Thanks a bunch for the suggestion, will try to work on it and reply for result
Software Developer
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT

Commented:
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).

Author

Commented:
Thanks pcelba for the code page settings, been searching it on google for a while and ur my answered prayer

Author

Commented:
Thanks a bunch olaf, will try it as well

Author

Commented:
Got my problem solved guys, thanks a lot for the help, you guys are awesome

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.