existing project and unicode

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
bbksimsky
Posts: 7
Joined: Sat 23 Jan 2010 02:07

existing project and unicode

Post by bbksimsky » Sat 23 Jan 2010 02:23

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 25 Jan 2010 08:22

You can replace TStringField with TWideStringField in *.pas and *.dfm files using a text editor that supports the Replace in Files feature.

bbksimsky
Posts: 7
Joined: Sat 23 Jan 2010 02:07

Post by bbksimsky » Mon 25 Jan 2010 20:52

Thank you for your answer.

I try your idea and come back tell you if it's ok or not.

Regards,

Simon

bbksimsky
Posts: 7
Joined: Sat 23 Jan 2010 02:07

Post by bbksimsky » Wed 27 Jan 2010 20:32

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

bbksimsky
Posts: 7
Joined: Sat 23 Jan 2010 02:07

Post by bbksimsky » Thu 28 Jan 2010 02:29

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,

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 28 Jan 2010 08:48

Please recreate fields for this query.

bbksimsky
Posts: 7
Joined: Sat 23 Jan 2010 02:07

Post by bbksimsky » Tue 09 Feb 2010 20:17

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 10 Feb 2010 13:09

Please recreate fields for one query that does not work with automatic replacement. Then see which fields are TWideStringField and which fields are TStringField.

bbksimsky
Posts: 7
Joined: Sat 23 Jan 2010 02:07

Post by bbksimsky » Wed 10 Feb 2010 19:11

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,

bbksimsky
Posts: 7
Joined: Sat 23 Jan 2010 02:07

Post by bbksimsky » Wed 10 Feb 2010 23:49

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

Post Reply