Recent

Author Topic: [SOLVED] Fields being Truncated  (Read 10227 times)

EgonHugeist

  • Jr. Member
  • **
  • Posts: 62
Re: Fields being Truncated
« Reply #15 on: October 11, 2012, 11:36:05 pm »
Ok i'll verify the problem with charset 'NONE' tomorrow evening. (sorry no time right now).
I have an idea: type 'NONE' into the TZConnection.ClientCodePage property or use an equal TZConnection.Properties.Values['Codepage'] := 'NONE'.

THEN i determine 1Byte/Char instead of 3! I made a little patch for Lazarus: IF the Lazarus user does not choose a ClientCodePage(CharacterSet) then i use an UTF8 compatible one for Lazarus (To avoid looping FAQ/reports of wrong written chars). Nothing prefents a Lazarus user to type in the correct Charset manually. Charset 'NONE' can't be converted to 'UTF8' with firebird except you use the converter functions..

To your question: 6.6.x won't work with FPC2.6 UP. You need Zeos7. Allways a good adress is the \trunk of the repositories.

Can you test my suggestion first?

Stag76

  • New Member
  • *
  • Posts: 33
Re: Fields being Truncated
« Reply #16 on: October 11, 2012, 11:44:02 pm »
I'm also out of time for a few hours.
I'm partway through the re-installation...have Lazarus installed, but still to do ZEOS.
I'll test your suggestion and get back to you ASAP.

Many Thanks.

EgonHugeist

  • Jr. Member
  • **
  • Posts: 62
Re: Fields being Truncated
« Reply #17 on: October 12, 2012, 11:09:17 am »
Any progress?

I'll make a patch for the CharSet 'NONE' and do not allow to change this CharSet. FireBird is also not able to convert any Chars to this charset

Stag76

  • New Member
  • *
  • Posts: 33
Re: Fields being Truncated
« Reply #18 on: October 12, 2012, 11:20:55 am »
I have got my laptop into a state where no version of ZEOS will compile or install, so I will have to re-install Windows and load up all the Software again.  I guess it is a result of installing and removing different versions and combinations. Probably be a couple of days.

Thanks for your help

Zoran

  • Hero Member
  • *****
  • Posts: 1459
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Fields being Truncated
« Reply #19 on: October 12, 2012, 12:01:11 pm »
I have got my laptop into a state where no version of ZEOS will compile or install, so I will have to re-install Windows and load up all the Software again.  I guess it is a result of installing and removing different versions and combinations. Probably be a couple of days.

Thanks for your help

Don't you think that reinstalling operating system is a very extreme measure for not being able to compile Zeos components? ;)

Before you do such a thing, please try to make sure all older versions of zeoslib are removed from your disk, then open and compile Zeos packages one by one in this order: 1. zcore, 2. zplain, 3. zparsesql, 4. zdbc, 5. zcomponent. For each of these packages make sure that you opened the package from the correct folder. Then install the last package (zcomponent). Recompile Lazarus and see if everything is okay.

I guess, Lazarus looks for some of the packages in some folder where previous version of zeos is and then try to combine these packages of different versions. This happened to me some time ago. If that is the case, what I suggested will help.

If not, well... go on reinstalling Windows. %)

Zoran

  • Hero Member
  • *****
  • Posts: 1459
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Fields being Truncated
« Reply #20 on: October 12, 2012, 12:25:47 pm »
I don't have this old version of Firebird to test, but I know that Firebird did not have utf8 charset before version 2.0. To make it worse, utf8 was alias to some buggy UNICODE_FSS encoding.

Please see the footnote in this page: http://www.firebirdsql.org/file/documentation/reference_manuals/reference_material/html/langrefupd25-charsets.html#ftn.d0e56367

It says:
Quote
In Firebird 1.5, UTF8 is an alias for UNICODE_FSS. This character set has some inherent problems. In Firebird 2, UTF8 is a character set in its own right, without the drawbacks of UNICODE_FSS.

I suppose that telling to FB 1.5 server that client encoding is utf8 might lead to some strange results...

Anyway, Firebird team stopped the support for FB 1.5 years ago... You should really start making plans about upgrading.

Take a look at this too: http://www.firebirdfaq.org/faq72/

And see also the last sentence in this page: http://www.firebirdfaq.org/faq81/
Quote
And make sure you use at least Firebird 2.0, which has excellent UTF8 support.

EgonHugeist

  • Jr. Member
  • **
  • Posts: 62
Re: Fields being Truncated
« Reply #21 on: October 12, 2012, 09:43:22 pm »
Ok i've testet it with charset 'NONE'. If Zeos know this CodePage then this issue is solved. (Which doesn't mean i won't think about a better solution.)

FireBird has two problems (as far as i know): You can't change the Client-Charset if you're connected and they have there issues with char convertations.

BUT Firebird is also my favourite of the free DBMRS. I propose you test my suggestion with charsert 'NONE' in the ClientCodePage property AND/or you make a backaup and update this deprecated server. This time use the UTF8 collation because Zoran is right the old UNICODE_FSS is a known trouble-maker and charset 'NONE' is not convertable.

Best regards, Michael

Stag76

  • New Member
  • *
  • Posts: 33
Re: Fields being Truncated
« Reply #22 on: October 12, 2012, 10:59:21 pm »
Hi Zoran,
I compiled the packages as you said, and each one stopped at line 84 in unit zClasses, which says
tContainedObject = Class(tAggregatedObject, IInterface),
and gives the error
No matching Implementation for Interface method "IUnknown QueryInterface(constref,tGuid,out<Formal type>):Longint,StdCall;"found

This is ZEOSDBO-7.0.0-alpha.

The project I'm working on is a data migration to move from FireBird 1.5 to SQL Server.
« Last Edit: October 12, 2012, 11:01:46 pm by Stag76 »

Stag76

  • New Member
  • *
  • Posts: 33
Re: Fields being Truncated
« Reply #23 on: October 13, 2012, 01:11:18 am »
I've downloaded and successfully installed ZEOSLIB-7.0.1-beta....looks like I was trying to install the wrong version :-[

I'll go back to testing the Character Set.

Stag76

  • New Member
  • *
  • Posts: 33
SOLVED Re: Fields being Truncated
« Reply #24 on: October 13, 2012, 01:40:50 am »
I've changed the TZConnection ClientCodePage Property to 'NONE' and it is no longer truncating the data. :)

All looks to be correct. :D

Thank you both for your prompt and accurate responses O:-)
« Last Edit: October 15, 2012, 11:40:25 pm by Stag76 »