Page 1 of 1
existing project and unicode
Posted: Sat 23 Jan 2010 02:23
by bbksimsky
Hello,
I have a delphi 2k5 project with ODAC 5.8xx . I switch to the new delphi 2010 with ODAC componant 6.90.0.51. No problem.
My customer wants to use those caractere: ĀāĒēĪīŌōŪū. So I want to use unicode, I change the UseUnicode property to "True". The problem was, in execution, I have an error "EdatabaseError: Wrong type for field 'xxx' wait:String Actualy:WideString"
It is possible to make an automatic conversion of all my string fields types in my project?
My apologies for my bad english.
Regards,
Sim
Posted: Mon 25 Jan 2010 08:22
by Plash
You can replace TStringField with TWideStringField in *.pas and *.dfm files using a text editor that supports the Replace in Files feature.
Posted: Mon 25 Jan 2010 20:52
by bbksimsky
Thank you for your answer.
I try your idea and come back tell you if it's ok or not.
Regards,
Simon
Posted: Wed 27 Jan 2010 20:32
by bbksimsky
Hello
I try to replace all TStringField in TWideStringField with notepad++
when I execute the project, I have an exception "EClassNotFound with message TWideStringF not found"
I search in my *.pas and *.dfm file about "TWideStringF" and I find nothing. The search and replace is ok in all my files.
thank for your help
Posted: Thu 28 Jan 2010 02:29
by bbksimsky
My mistake, you can forget my previous post.
Now i have an EDatabaseError when I open query:
"Wait: WideStrind, actual: String". I check all fields declaration in .pas and .dfm, it's TWideStringField
And if I change UseUnicode propertie to False, I have this: "Wait: String, actual: WideString".
Regards,
Posted: Thu 28 Jan 2010 08:48
by Plash
Please recreate fields for this query.
Posted: Tue 09 Feb 2010 20:17
by bbksimsky
Hi,
It's a problem in my case: I have a big projet with a lot of string field which have a lot of evenement... Unfortunatly I can't waste time for this.
Is Any convertion tools exists?
Thx
Posted: Wed 10 Feb 2010 13:09
by Plash
Please recreate fields for one query that does not work with automatic replacement. Then see which fields are TWideStringField and which fields are TStringField.
Posted: Wed 10 Feb 2010 19:11
by bbksimsky
ok, I try your suggestion:
In the main form, I have 3 query. Two of them don't have problem. The fields are TWideStringFiled, and I can open them.
The third, I recreate the String field. The the new is TstringField but when I open it, I have an exception: Wait:WideString: Actual:String.
I don't understand!
Thank you for your help
Regards,
Posted: Wed 10 Feb 2010 23:49
by bbksimsky
Hello again,
I find the problem: I create an OraSession object for each form, and any of the don't have the True value for UseUnicode propertie.
Thank you very much for your time