Page 1 of 1

Install problem under Delphi 5

Posted: 28.04.2006, 09:16
by Petya
Hello EveryBody,

I tried to install all three new CVS releases for Delphi 5, but all the three produces the same error when compiling ZDbc.bpl :
DateUtils.dcu not found in ZDbcMySqlStatement.pas
This native VCL unit yet doesn't exist in Delphi 5.
It is used by three DecodeDateTime calls in the end of the unit. I tried to change these calls to its corresponding Delphi 5 functions, but further errors arose :

Code: Select all

[Error] ZAbstractDataset.pas(417): Incompatible types: 'Variant' and 'Int64'
Offending line is :

Code: Select all

procedure TZAbstractDataset.InternalPost;
var
  RowBuffer: PZRowBuffer;
begin
  if (FSequenceField <> '') and Assigned(FSequence) then
  begin
    if FieldByName(FSequenceField).IsNull then
      FieldByName(FSequenceField).Value := FSequence.GetNextValue;  <<<--- This line doesn't compile
  end;

  inherited;
It seems to me that these new releases doesn't like Delphi 5.
I've tried them in Delphi 7, they're all OK.
I write a communication program in Delphi 5 and I use its native TCP components which are completely different in Delphi 7.
So I'm currently not in the position of switching several components in my almost finished project ...

Thanks for any help :-))

Cheers,
Peter

Posted: 28.04.2006, 10:29
by mdaems
Hi,

I've noticed this problem as well. Changing the code to avoid the DecodeDateTime call shouldn't be a big problem, I think.
To all, is there a reason why we should use this DecodeDateTime in newer Delphi verions if possible? If not I propose to change it for all languages.

If I'm not mistaken FSequence is quite new, so I hope not everything in that code is bugged that way. Maybe I'll have a look at it, as soon as I know how you fixed the problem I have with line endings. Did you have to fix something ? Or don't you have a problem with the CVS versions? I had.

BTW, did you know we're using SVN since some time? Have you tried that version? (For details concerning the SVN repository, please search the forum)

Mark

Posted: 28.04.2006, 10:55
by btrewern
It looks like Delphi 5 has doesn't support Int64 in variants. I think a work round would be to use something like:

Code: Select all

FieldByName(FSequenceField).AsString := IntToStr(FSequence.GetNextValue);
Regards,

Ben

Posted: 28.04.2006, 12:31
by Petya
mdaems, you are probably affiliated with the Zeoslib development team, aren't you ?

Now I tell you exactly what I did in Delphi 5 :

1. Extracted zeosdbo-6.5.1-alpha_cvs_13-10-2005.zip into separate folder.
2. Opened packages/delphi5/ZeosDbo.bpg.
3. Compile all failed at ZDbc.bpl with DateUtils.dcu not found in ZDbcMySqlStatement.pas
4. Removed DateUtils from uses section, changed ZDbcMySqlStatement.pas code from this :

Code: Select all

      begin
        DecodeDateTime(SoftVarManager.GetAsDateTime(Value),
          AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond);
        Result := '''' + Format('%0.4d-%0.2d-%0.2d',
          [AYear, AMonth, ADay]) + '''';
      end;
      stTime:
      begin
        DecodeDateTime(SoftVarManager.GetAsDateTime(Value),
          AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond);
        Result := '''' + Format('%0.2d:%0.2d:%0.2d',
          [AHour, AMinute, ASecond]) + '''';
      end;
      stTimestamp:
      begin
        DecodeDateTime(SoftVarManager.GetAsDateTime(Value),
          AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond);
        Result := '''' + Format('%0.4d-%0.2d-%0.2d %0.2d:%0.2d:%0.2d',
          [AYear, AMonth, ADay, AHour, AMinute, ASecond]) + '''';
      end;
to this :

Code: Select all

      begin
        DecodeDate(SoftVarManager.GetAsDateTime(Value),
          AYear, AMonth, ADay);
        Result := '''' + Format('%0.4d-%0.2d-%0.2d',
          [AYear, AMonth, ADay]) + '''';
      end;
      stTime:
      begin
        DecodeTime(SoftVarManager.GetAsDateTime(Value),
          AHour, AMinute, ASecond, AMilliSecond);
        Result := '''' + Format('%0.2d:%0.2d:%0.2d',
          [AHour, AMinute, ASecond]) + '''';
      end;
      stTimestamp:
      begin
        DecodeDate(SoftVarManager.GetAsDateTime(Value),
          AYear, AMonth, ADay);
        DecodeTime(SoftVarManager.GetAsDateTime(Value),
          AHour, AMinute, ASecond, AMilliSecond);
        Result := '''' + Format('%0.4d-%0.2d-%0.2d %0.2d:%0.2d:%0.2d',
          [AYear, AMonth, ADay, AHour, AMinute, ASecond]) + '''';
      end;
5. ZDbcMySqlStatement.pas compiled, but further errors came.
6. [Error] ZDbc.dpk(85): 'END' expected but identifier 'ZDbcASAUtils' found

Code: Select all

  ZDbcSqLiteStatement in '..\..\src\dbc\ZDbcSqLiteStatement.pas',
  ZDbcSqLiteResultSet in '..\..\src\dbc\ZDbcSqLiteResultSet.pas',
  ZDbcSqLiteMetadata in '..\..\src\dbc\ZDbcSqLiteMetadata.pas';    <<<--- 
  ZDbcASAUtils in '..\..\src\dbc\ZDbcASAUtils.pas',
  ZDbcASAMetadata in '..\..\src\dbc\ZDbcASAMetadata.pas',
  ZDbcASAResultSet in '..\..\src\dbc\ZDbcASAResultSet.pas',
  ZDbcASAStatement in '..\..\src\dbc\ZDbcASAStatement.pas',
  ZDbcASA in '..\..\src\dbc\ZDbcASA.pas';

end.
7. Changed the semicolon to colon.
8. [Fatal Error] ZDbcASA.pas(44): File not found: 'Types.dcu'

Code: Select all

unit ZDbcASA;

interface

{$I ZDbc.inc}

uses
  ZCompatibility, Types, Classes, Contnrs, SysUtils, ZDbcIntfs,
  ZDbcConnection, ZPlainASADriver, ZSysUtils, ZTokenizer,
  ZDbcGenericResolver, ZGenericSqlAnalyser;

type
9. Removed Types from uses section with fear from consequences ...
10. [Fatal Error] ZDbcASAUtils.pas(247): File not found: 'Variants.dcu'

Code: Select all

implementation

uses Variants, ZMessages, ZDbcCachedResultSet, Math;

{ TZASASQLDA }
11. Removed Variants with even stronger fear ...
12. :

Code: Select all

[Warning] ZDbcASAUtils.pas(477): FOR-Loop variable 'Result' may be undefined after loop
[Error] ZDbcASAUtils.pas(1010): Undeclared identifier: 'varWord'
[Error] ZDbcASAUtils.pas(1012): Undeclared identifier: 'varLongWord'
[Error] ZDbcASAUtils.pas(1012): Duplicate case label
[Error] ZDbcASAUtils.pas(1022): Undeclared identifier: 'varShortInt'
[Error] ZDbcASAUtils.pas(1022): Duplicate case label
[Error] ZDbcASAUtils.pas(1110): Undeclared identifier: 'PLongWord'
[Error] ZDbcASAUtils.pas(1110): Pointer type required
[Error] ZDbcASAUtils.pas(1148): Undeclared identifier: 'PLongWord'
[Error] ZDbcASAUtils.pas(1148): Pointer type required
[Error] ZDbcASAUtils.pas(1186): Undeclared identifier: 'PLongWord'
[Error] ZDbcASAUtils.pas(1186): Pointer type required
[Error] ZDbcASAUtils.pas(1259): Undeclared identifier: 'PLongWord'
[Error] ZDbcASAUtils.pas(1259): Pointer type required
[Error] ZDbcASAUtils.pas(1297): Undeclared identifier: 'PLongWord'
[Error] ZDbcASAUtils.pas(1297): Pointer type required
[Error] ZDbcASAUtils.pas(1335): Undeclared identifier: 'PLongWord'
[Error] ZDbcASAUtils.pas(1335): Pointer type required
[Error] ZDbcASAUtils.pas(1373): Undeclared identifier: 'PLongWord'
[Error] ZDbcASAUtils.pas(1373): Pointer type required
[Error] ZDbcASAUtils.pas(1434): Undeclared identifier: 'PLongWord'
[Error] ZDbcASAUtils.pas(1434): Pointer type required
[Error] ZDbcASAUtils.pas(1442): Too many actual parameters
[Error] ZDbcASAUtils.pas(1471): Undeclared identifier: 'PLongWord'
[Error] ZDbcASAUtils.pas(1471): Pointer type required
[Error] ZDbcASAUtils.pas(1549): Undeclared identifier: 'PLongWord'
[Error] ZDbcASAUtils.pas(1549): Pointer type required
[Fatal Error] ZDbcASAMetadata.pas(200): Could not compile used unit 'ZDbcASAUtils'
13. [Error] Too many errors, process halted.

14. Neither types.dcu nor Variants.dcu was not found in a full install to C:\Program Files\Borland\Delphi5\

This was conducted with the 13-10-2005 CVS release. The int64/variant conversion error in the first message was with one of the other files.

15. What did I miss or done wrong and what's the solution ?

Posted: 28.04.2006, 12:45
by Petya
16. Changed the end of ZDbc.dpk from :

Code: Select all

  ZDbcSqLiteStatement in '..\..\src\dbc\ZDbcSqLiteStatement.pas', 
  ZDbcSqLiteResultSet in '..\..\src\dbc\ZDbcSqLiteResultSet.pas', 
  ZDbcSqLiteMetadata in '..\..\src\dbc\ZDbcSqLiteMetadata.pas';    <<<--- 
  ZDbcASAUtils in '..\..\src\dbc\ZDbcASAUtils.pas', 
  ZDbcASAMetadata in '..\..\src\dbc\ZDbcASAMetadata.pas', 
  ZDbcASAResultSet in '..\..\src\dbc\ZDbcASAResultSet.pas', 
  ZDbcASAStatement in '..\..\src\dbc\ZDbcASAStatement.pas', 
  ZDbcASA in '..\..\src\dbc\ZDbcASA.pas'; 

end.
to :

Code: Select all

  ZDbcSqLiteStatement in '..\..\src\dbc\ZDbcSqLiteStatement.pas', 
  ZDbcSqLiteResultSet in '..\..\src\dbc\ZDbcSqLiteResultSet.pas', 
  ZDbcSqLiteMetadata in '..\..\src\dbc\ZDbcSqLiteMetadata.pas'; 

end.
17. [Error] ZAbstractDataset.pas(417): Incompatible types: 'Variant' and 'Int64'
[Fatal Error] ZAbstractRODataset.pas(385): Could not compile used unit '..\..\src\component\ZAbstractDataset.pas'
18. Changed ZAbstractDataset.pas as suggested from :

Code: Select all

procedure TZAbstractDataset.InternalPost; 
var 
  RowBuffer: PZRowBuffer; 
begin 
  if (FSequenceField <> '') and Assigned(FSequence) then 
  begin 
    if FieldByName(FSequenceField).IsNull then 
      FieldByName(FSequenceField).Value := FSequence.GetNextValue;  
  end; 

  inherited;
  
To:

Code: Select all

procedure TZAbstractDataset.InternalPost; 
var 
  RowBuffer: PZRowBuffer; 
begin 
  if (FSequenceField <> '') and Assigned(FSequence) then 
  begin 
    if FieldByName(FSequenceField).IsNull then 
      FieldByName(FSequenceField).AsString := IntToStr(FSequence.GetNextValue);
  end; 

  inherited;
  
19. :
[Error] ZAbstractRODataset.pas(839): Undeclared identifier: 'ApplicationHandleException'
[Error] ZAbstractRODataset.pas(962): Undeclared identifier: 'ftTimestamp'
[Error] ZAbstractRODataset.pas(2932): Undeclared identifier: 'ftTimeStamp'
[Error] ZAbstractRODataset.pas(2932): Undeclared identifier: 'ftFMTBcd'
[Fatal Error] ZSqlStrings.pas(109): Could not compile used unit 'ZAbstractRODataset'

20. Got tired.
21. Someone please suggest something.

Posted: 29.04.2006, 00:05
by mdaems
Petya,

I'm not really a 'team member'. i just try to help people out and hope ZEOS gets to a production version again.
I've tried tonight to compile the whole package on D5. I almost succeeded. In fact, it compiles well, but I can't get it installed, and installation works perfectly for the 2004 alpha version. Something with VCL50Db.dll. Normally that hasto do with conflicting Delphi versions (running5,7,2006) or old copies of zeos somewhere on the PC. I just can't find it. Eventually I could try to send you my result, hoping you can find what's wrong? If so, please send me an email-address by pm, so we can give it a try.

Mark

Posted: 16.06.2006, 13:38
by Petya
Hello Mark,

There has been another thread discussing the same theme where you suggested me, and I promised you to try the SVN repository about a month before. I've lost that other topic because of the forum movement, but I can give you good news that your changes you made then are working for me !

So thank you for the effort.

Cheers,
Peter