Recent

Author Topic: Lazarus with ZEOS  (Read 1954 times)

Cuci

  • New member
  • *
  • Posts: 7
Lazarus with ZEOS
« on: March 03, 2019, 09:41:33 pm »
Hello, please excuse my bad English . . .
I am transforming my Delphi-2010 program to Lazarus under Linux Mint 18.3. Now I must stop because Lazarus will not acept TZQuery in my lines . . .
Here the example:
 Delphi :      FData.TableVertragAusglBetrag.Value := Mietdauer * (FData.FindComponent(PrsAltNeu) as TQuery).FieldByName('AboHoch').Value;
 Lazarus :    DaMod1.ZQy_vertragAusglBetrag.Value := Mietdauer * (DaMod1.FindComponent(PrsAltNeu) as TZQuery).FieldByName('AboHoch').Value;

May be someone knows the reason for : Identifier not found "TZQuery"

Greetings Cuci

Lazarus 1.8.0  /  ZEOS 7.1.4

GAN

  • Full Member
  • ***
  • Posts: 223
Re: Lazarus with ZEOS
« Reply #1 on: March 03, 2019, 10:40:25 pm »
Hi, in the uses section of your data module, do you have the unit ZDataset ? And in the standar unit has declared the data module unit in the uses section too?
Lazarus 1.8.4 FPC 3.0.4 Linux Mint Mate 17.2 x86_64 GTK-2
Zeos 7.1.3 - Sqlite 3.8.2

Foro Lazarus en español http://forum.lazarus.freepascal.org/index.php/board,73.0.html

Cuci

  • New member
  • *
  • Posts: 7
Re: Lazarus with ZEOS
« Reply #2 on: March 03, 2019, 11:00:58 pm »
Hello GAN, thanks for your answer, look please on the declarations in my program

unit data;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, mysql55conn, sqldb, db, FileUtil, ZConnection, ZDataset;     
___________________________________________________________________

unit main;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, mysql55conn, sqldb, db, FileUtil, DBDateTimePicker, Forms,
  Controls, Graphics, Dialogs, ComCtrls, ExtCtrls, Menus, DBGrids, DbCtrls,
  StdCtrls, DBExtCtrls, Types, data;   


GAN

  • Full Member
  • ***
  • Posts: 223
Re: Lazarus with ZEOS
« Reply #3 on: March 04, 2019, 01:14:41 am »
I'm sorry, I've never used FindComponent. Can't you use it directly?

Code: Pascal  [Select]
  1. DaMod1.ZQy_vertragAusglBetrag.Value := DaMod1.PrsAltNeu.FieldByName('AboHoch').value;
  2.  

and see if the error continues?

And by the way, what's ZQy_vertragAusglBetrag? If it's a TZQuery your code is wrong.
Lazarus 1.8.4 FPC 3.0.4 Linux Mint Mate 17.2 x86_64 GTK-2
Zeos 7.1.3 - Sqlite 3.8.2

Foro Lazarus en español http://forum.lazarus.freepascal.org/index.php/board,73.0.html

af0815

  • Sr. Member
  • ****
  • Posts: 345
Re: Lazarus with ZEOS
« Reply #4 on: March 04, 2019, 08:46:59 am »
Make a new, empty project an place all parts of zeos you want to use on it. Look for the generated uses line. Add the same in your project.
And you have to add a requirement for zeos in your project.
regards
Andreas

Cuci

  • New member
  • *
  • Posts: 7
Re: Lazarus with ZEOS
« Reply #5 on: March 04, 2019, 10:37:48 pm »
Hi Andreas,
how can I add a requirement for Zeos?

kapibara

  • Hero Member
  • *****
  • Posts: 511
Re: Lazarus with ZEOS
« Reply #6 on: March 04, 2019, 11:10:27 pm »
Lazarus Mainmenu -> Project -> Project Inspector -> Add -> Add New Requirement
Lazarus trunk / fpc 3.0.4 / Debian Stretch 64-bit

Cuci

  • New member
  • *
  • Posts: 7
Re: Lazarus with ZEOS
« Reply #7 on: March 05, 2019, 10:37:54 pm »
Hello, thank you for your help.
I checked all, the invironment ist ok but it dosn't work. So I go another way with the double of code for this part.
Bye Cuci