Recent

Author Topic: Lazarus with ZEOS  (Read 4234 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

  • Sr. Member
  • ****
  • Posts: 376
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 2.0.8 FPC 3.0.4 Linux Mint Mate 19.3
Zeos 7̶.̶2̶.̶6̶ 7.1.3a-stable - Sqlite 3.32.3 - LazReport

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

  • Sr. Member
  • ****
  • Posts: 376
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 2.0.8 FPC 3.0.4 Linux Mint Mate 19.3
Zeos 7̶.̶2̶.̶6̶ 7.1.3a-stable - Sqlite 3.32.3 - LazReport

af0815

  • Hero Member
  • *****
  • Posts: 1379
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: 629
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.2.2 / Kubuntu 22.04 - 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

 

TinyPortal © 2005-2018