Lazarus
Programming => Databases => Topic started by: Stevie on May 03, 2005, 07:32:58 pm
-
Hi everyone,
the port to lazarus is done - fpc now has full support for variants and interfaces. Because the port is not "much more" than "a few" compiler directives, therefore the functionality is the same as it is on delphi or kylix. The sources you can get from the cvs on http://sourceforge.net/projects/zeoslib/
Regards,
Stevie
-
Could you give a little bit detailed download and build instructions ?
-
Stevie, may I suggest you create a zip with the needed sources and lazarus package? I think it would be great to have this component on Lazarus Code and Components (http://lazarus-ccr.sourceforge.net/kb/index.php/Code_And_Components) page and available for download at the Lazarus CCR Files (http://sourceforge.net/project/showfiles.php?group_id=92177) page.
-
@ Stevie:
I reported a Patch (https://sourceforge.net/tracker/index.php?func=detail&aid=1195042&group_id=35994&atid=415826) for FPC/Lazarus under linux.
Cause there are some functions missing.
And I reported a bug (https://sourceforge.net/tracker/index.php?func=detail&aid=1195034&group_id=35994&atid=415824).
Cause under Linux the Firebird and SQLite driver will raise a range check error when you set the Connected propertie of the TZConnection to true.
This will only happen when yyou set the propertie in the IDE to true for testing.
@Guest:
You need a CVS client for getting this great piece of software. ;)
If you use Windows then try TortoiseCVS (http://www.tortoisecvs.org/).
The CVS server is: cvs.sourceforge.net
Username: anonymous
Repository Path: /cvsroot/zeoslib
No password.
Checkout the zeosdbo_rework (this is the actual Zeos).
After checking out install the components in the following order:
zcore.lpk
zparsesql.lpk
zplain.lpk
zdbc.lpk
zcomponent.lpk
-
I did some browsing through the cvs and have some questions/suggestions/remarks.
The zcomponent package has a absolute path to the include files:
<IncludeFiles Value="E:\Programme\Lazarus\components\zeos\src\component\"/>
If I understand the lazarus pacakge system correctly, the zcore, zparsesql, zplain and the zdbc package can be a runtime package only, because they don't install any components. Of course other packages can use it, and it still will be included in the lazarus executable.
-
@hombergs: I must confess that I only tested the windows version of Lazarus but this was only the first step. I try to setup a linux-system for testing and look for it, thanks!
@vincent: Yes, you are right, but in the past the delphi-packages of zeos had to be installed too (I changed this already) I still am not very familiar with Lazarus but a few weeks ago I was not able to install only the component package without the others (maybe this behaviour changed? I will test this)
-
Thank you, I will try it. The "zeosdbo_rework" was the missing info. I tired checkout zeosdbo, but all files seems very old. The rework seems far better :-)
-
@Stevie: I found the bug. FPC/Lazarus defines HMODULE as longint. But the dlopen function from libc returns sometimes a negative value. So I redifine HMODULE in ZCompatibility as longword now and it works. I uploaded a new patchfile. This include the changes that Vincent has suggested. ;)
-
I tired to compile it, but I've got the following error messages:
Zeos.inc(42,2) Warning: Unsupported switch "$O"
Zeos.inc(44,2) Warning: Unsupported switch "$W"
Zeos.inc(42,2) Warning: Unsupported switch "$O"
Zeos.inc(44,2) Warning: Unsupported switch "$W"
Zeos.inc(42,2) Warning: Unsupported switch "$O"
Zeos.inc(44,2) Warning: Unsupported switch "$W"
Zeos.inc(42,2) Warning: Unsupported switch "$O"
Zeos.inc(44,2) Warning: Unsupported switch "$W"
/usr/lib/lazarus/zeos/src/plain/ZPlainLoader.pas(150,17) Error: Identifier not found "GetModuleHandle"
/usr/lib/lazarus/zeos/src/plain/ZPlainLoader.pas(154,19) Error: Identifier not found "HMODULE"
/usr/lib/lazarus/zeos/src/plain/ZPlainLoader.pas(181,5) Error: Identifier not found "FreeLibrary"
/usr/lib/lazarus/zeos/src/plain/ZPlainLoader.pas(181,24) Error: Illegal expression
/usr/lib/lazarus/zeos/src/plain/ZPlainLoader.pas(193,13) Error: Identifier not found "GetProcAddress"
/usr/lib/lazarus/zeos/src/plain/ZPlainLoader.pas(199) Fatal: There were 5 errors compiling module, stopping
The GetModuleHandle, etc seems WIN32 functions, I tired to compile it under linux (with the latest fpc binary snapshot).
-
Please apply the patch from the zeos patch tracker.
The direct link to the patch is in my first post.
The attached file is the newest patch.
After applying the patch Zeos will compile under Linux without a problem.
-
I added your changes into the actual sources a few minutes ago. Now it should be compilable on linux.
-
I did a small test using the firebird 1.5 employee sample database, it seems to have problems with some numeric fields? check for example the DEPARTMENT and SALARY_HISTORY tables, here is a link to the lazarus project: http://mx.geocities.com/jesusrmx/lazarus/zeos_fbbrowser.tgz
-
I'm sorry, but when I tired the compile it under linux, I've got the following messages:
/usr/lib/lazarus/zeos/src/core/ZCompatibility.pas(132,13) Hint: Type "HMODULE" redefinition
/usr/lib/lazarus/zeos/src/core/ZCompatibility.pas(190,21) Error: Identifier not found "dl"
-
open ZCompatibility.pas and remove the "dl." prefix from each line that fails.
-
Thank you, it is work for me!
-
I did a small test using the firebird 1.5 employee sample database, it seems to have problems with some numeric fields? check for example the DEPARTMENT and SALARY_HISTORY tables, here is a link to the lazarus project: http://mx.geocities.com/jesusrmx/lazarus/zeos_fbbrowser.tgz
I found the problem.
When you use the EditFormat (TDbEdit) or DisplayFormat (TDbGrid Column) propertie the Access Violation will not occur.
So i will get deeper into it.
-
Think I found the bug and submitted it to the FreePascal-Bugtracker (http://www.freepascal.org/bugs/edit.php3?ID=3957)
-
Bug ID 3957 is fixed in the CVS.
-
great, it works. I tried to install in windows, had some minor problems and it's working ok too.
The kind of problem is as follow for several files:
Index: ZDbcMetadata.pas
===================================================================
RCS file: /cvsroot/zeoslib/zeosdbo_rework/src/dbc/ZDbcMetadata.pas,v
retrieving revision 1.39
diff -c -r1.39 ZDbcMetadata.pas
*** ZDbcMetadata.pas 4 May 2005 16:22:40 -0000 1.39
--- ZDbcMetadata.pas 11 May 2005 04:57:54 -0000
***************
*** 47,53 ****
{$ENDIF}
{$IFDEF VER130BELOW}
{$IFDEF WIN32}
! Comobj,
{$ENDIF}
{$ENDIF}
Classes, SysUtils, Contnrs, ZSysUtils, ZClasses, ZDbcIntfs, ZTokenizer,
--- 47,53 ----
{$ENDIF}
{$IFDEF VER130BELOW}
{$IFDEF WIN32}
! //Comobj,
{$ENDIF}
{$ENDIF}
Classes, SysUtils, Contnrs, ZSysUtils, ZClasses, ZDbcIntfs, ZTokenizer,
I didn't offer the patch because I know too little about zeoslib internals
-
Hi,
Good work! I just downloaded the latest CVS.
Three questions:
1. I am trying to set a master-detail relation between two queries by using a Param in the SQL statement of the detail query. In Delphi this works but in Lazarus the detail query is empty. How can I solve this (I'd rather not use the 'Mastersource' option)?
2. Is there a problem with the Date type because all the years are displayed as 1899?
3. Is there ever going to be a Field Editor (like in Delphi)?
Thanks,
Edwin
-
Hi,
I've got a problem with using zeoslib with sqlite and mysql. Storing data works just fine, but to retrieve information from the database I have to use a construction with "ZQuery1.Open" which produces an exception regardless in what situation.
The error code returned by the debugger is: "Project project1 raises exception class EZSQLException."
Thanks in advance
-
I've got a problem with installing zeoslib
in zcompatiblity.pas on line 170
LText := PChar(S);
--> error "Illegal type conversion Shortstring to ^Char"
Thanks in advance
-
Did you check out the lazarus-versions of packages also?
Either you did not or you deactivated the "Delphi comapatible"-Compilerswitch. (-Sd)
-
I've got another problem with instaling zeoslib
in zdbconnection.pas line 331
Analyser := TZGenericStatementAnalyser.Create;
Argument can't be assigned to
-
Do you have the latest version of lazarus???
I had this error with one version weeks ago, but it is already fixed.
-
Now i have the latest version of lazarus and instaled zeoslib:)
I have one more question: where is fields editor or something similar to add at design time fileds to TZquery?
Best regards
Romek
-
Why is the master-detail relation through the Datasource property (so with a :Param in the SQL) of ZQuery not working?
Thanks,
Edwin
-
@romekf: This should be implemented by lazarus i.e. the lcl.
@Guest: I think, this is also a problem with missing implementation within the lcl (db.pas)
-
@Stevie: Thanks for your reply.
I don't think it is a problem within the lcl, because using UIB (with TFBDataset) it is working!
Another thing: what is wrong with the Date field (everything is 30/12/1899)?
By the way, I'm using Firebird 1.5.
Thanks,
Edwin
-
I tired to compile the lastest cvs snapshot, but I've got the following messange:
/usr/lib/lazarus/zeos/src/component/ZSqlStrings.pas(63,5) Warning: Constructor should be public
/usr/lib/lazarus/zeos/src/component/ZAbstractRODataset.pas(57,19) Hint: Type "TUpdateStatus" redefinition
/usr/lib/lazarus/zeos/src/component/ZAbstractRODataset.pas(261,15) Error: There is no method in an ancestor class to be overridden: "TZAbstractRODataset.CheckFieldCompatibility(TField, TFieldDef)"
/usr/lib/lazarus/zeos/src/component/ZAbstractRODataset.pas(334,14) Warning: An inherited method is hidden by "TZAbstractRODataset.Locate(const AnsiString,const Variant, TLocateOptions):Boolean"
/usr/lib/lazarus/zeos/src/component/ZAbstractRODataset.pas(379,1) Fatal: There were 1 errors compiling module, stopping
I removed the "override" from the end of the
procedure CheckFieldCompatibility(Field: TField; FieldDef: TFieldDef); override; line, but
when I tired to compile the stuff the next error is
/usr/lib/lazarus/zeos/src/component/ZStreamBlob.pas(1,1) Fatal: Can't find unit DBConsts
-
edit file ZAbstractRODataset.pas
uses Math, ZVariant, ZMessages, ZDatasetUtils, ZStreamBlob, ZSelectSchema,
ZGenericSqlToken, ZTokenizer,
{$IFNDEF FPC}
DBConsts,
{$ENDIF}
ZGenericSqlAnalyser ;
-
edit file ZAbstractRODataset.pas
uses Math, ZVariant, ZMessages, ZDatasetUtils, ZStreamBlob, ZSelectSchema,
ZGenericSqlToken, ZTokenizer,
{$IFNDEF FPC}
DBConsts,
{$ENDIF}
ZGenericSqlAnalyser ;
after that we have the following error
Error: Identifier not found 'SNotEditing' line 1210
-
There are two steps to solve this problem:
1. in section uses add: {$IFDEF FPC}dbconst{$ELSE}DBConsts{$ENDIF};
2. add to pp\units\i386-win32\fcl\dbconst.pp following three lines
SNotEditing = 'Not in edit mode';
SFieldTypeMismatch = 'Field ''%s'' is not of the expected type';
SFieldSizeMismatch = 'Size mismatch for field ''%s'', expecting: %d actual: %d';
after that you have to compile unit db.pp
-
Thank you, it works.
-
Hi,
I'm trying to install the zeoslib in lazarus, I get the zeos code through the CVS repository and lazarus in snapshot site (0.9.7 beta) I got to compile all packages, less the zcomponents, the following errors/warnings occurs :
Errors:
C:\lazarus\components\zeosdbo_rework\src\component\ZAbstractRODataset.pas(261,15) Error: There is no method in an ancestor class to be overridden: "TZAbstractRODataset.CheckFieldCompatibility(TField, TFieldDef)"
C:\lazarus\components\zeosdbo_rework\src\component\ZAbstractRODataset.pas(345,14) Error: Not all declarations of "GetFieldData" are declared with OVERLOAD
All:
"Compile IDE (without linking)" completed
C:\lazarus\components\zeosdbo_rework\src\component\ZSqlStrings.pas(63,5) Warning: Constructor should be public
C:\lazarus\components\zeosdbo_rework\src\component\ZAbstractRODataset.pas(57,19) Hint: Type "TUpdateStatus" redefinition
C:\lazarus\components\zeosdbo_rework\src\component\ZAbstractRODataset.pas(244,15) Warning: An inherited method is hidden by "TZAbstractRODataset.SetFieldData(TField, Pointer, Boolean)"
C:\lazarus\components\zeosdbo_rework\src\component\ZAbstractRODataset.pas(261,15) Error: There is no method in an ancestor class to be overridden: "TZAbstractRODataset.CheckFieldCompatibility(TField, TFieldDef)"
C:\lazarus\components\zeosdbo_rework\src\component\ZAbstractRODataset.pas(334,14) Warning: An inherited method is hidden by "TZAbstractRODataset.Locate(const AnsiString,const Variant, TLocateOptions):Boolean"
C:\lazarus\components\zeosdbo_rework\src\component\ZAbstractRODataset.pas(336,14) Warning: An inherited method is hidden by "TZAbstractRODataset.Lookup(const AnsiString,const Variant,const AnsiString):Variant"
C:\lazarus\components\zeosdbo_rework\src\component\ZAbstractRODataset.pas(345,14) Warning: An inherited method is hidden by "TZAbstractRODataset.GetFieldData(TField, Pointer, Boolean):Boolean"
C:\lazarus\components\zeosdbo_rework\src\component\ZAbstractRODataset.pas(345,14) Error: Not all declarations of "GetFieldData" are declared with OVERLOAD
C:\lazarus\components\zeosdbo_rework\src\component\ZAbstractRODataset.pas(349,14) Warning: An inherited method is hidden by "TZAbstractRODataset.UpdateStatus:<enumeration type>"
C:\lazarus\components\zeosdbo_rework\src\component\ZAbstractRODataset.pas(379,1) Fatal: There were 2 errors compiling module, stopping
____
There is a fix?
-
Hello,
due to be compatible to lazarus - which still has some missing pieces :-( - I added the used DBConsts to ZMessages.pas.
Sorry for that trouble with non-compileable sources, but at the moment I am working with delphi 2005 and unfortunately I did not check any changes with lazarus if it works on delphi. I will do so in future, so you can get the latest version running on your lazarus. ;-)
Regards
Stevie
-
When I connect a Data Control (TDBGrid/TDBEdit) to an active TZQuery I get an 'Unknown Run-Time error : 202'. I use a recent Lazarus and Zeos.
Can this be fixed?
Thanks,
Edwin
-
Hi Edwin,
the bug has been fixed.
Regards
-
Thanks for your reply Stevie....
but it's not working, still the same error.
Edwin
-
A bit too fast....
It is working now.
Thanks Stevie.
BTW, is the problem with the master-detail relation through the Datasource property (so with a :Param in the SQL) of ZQuery going to be solved or do I really have to use the Mastersource property (Query opens a lot slower)?.
-
Stevie,
i have firebird database with field size VARCHAR(32000) in it... if i read from this field with zeosdbo my progy crash... if i change size of this field to size VARCHAR(254), it's all ok... i'm compiling with fpc 2.0.1 and latest lazarus from cvs... zeosdbo is from cvs (latest)...
-
Hi Barko,
this is a limitation of zeos (and a known bug, see the knownbug-file). Don't know when it will be fixed. :-/
-
I can't find FindNearest / FindKey function in TZQuery/TZTable. Why ?
-
I can't find FindNearest / FindKey function in TZQuery/TZTable. Why ?
Because these methods are not implemented yet ;-)
-
Hi All,
What must I download to enable me to connect to a MS-SQL 2000 database?
Thanks
Dougie
-
I am trying to compile the sources, I am having a lot of trouble. I am fairly new to Lazarus (have been using Delphi since V1). Could someone please just tell me the following:
- what compiler settings must be on for it to compile ?
- what order must the paths be in ?
I have managed to get zcore, zplain and zparsesql to compile with great difficulty, but now I am stuck on zdbc with the following errors:
ZDbcMetadata.pas(303,34) Error: No matching implementation for interface method "IZIdentifierConvertor.IsQuoted(ShortString):Boolean" found
ZDbcMetadata.pas(303,34) Error: No matching implementation for interface method "IZIdentifierConvertor.Quote(ShortString):ShortString" found
ZDbcMetadata.pas(303,34) Error: No matching implementation for interface method "IZIdentifierConvertor.ExtractQuote(ShortString):ShortString" found
Thanx
Johan
-
Hi all, to install zeos_rework I followed the instructions given on the mailing list some time ago:
"After the files are downloaded, fire Lazarus and open and compile de
zeos packages in the following order:
zcore.lpk
zparsesql.lpk
zplain.lpk
zdbc.lpk
Then finally open zcomponent.lpk and compile and install this package.
NB. The first four packages only need to be compiled! In fact they
cannot be installed."
-
I did follow the instructions, but when I try to compile, I get the errors mentioned in my prevoius post. I have to add that I am trying to compile under Linux (SUSE Pro 9.3)
-
Hello,
Is there a way to use an 'EditMask' (as in Delphi) for StringFields in a ZQuery?
I'd like the user input (in a DBGrid) to be automatically in capitals without having to use CapsLock.
Thanks,
Edwin
-
zeoslib 6.5.1 for lazarus win32
Installed!!!!!
and working.
When I can I place a link for download.
Respectfully
Silvio Guedes
-
Guest, Hi!
Can u tell us how do u that?
And give us the Zeos , I am a newbie and I dont find anything
-
Hello,
Is there a way to use an 'EditMask' (as in Delphi) for StringFields in a ZQuery?
I'd like the user input (in a DBGrid) to be automatically in capitals without having to use CapsLock.
Thanks,
Edwin
TField doesn't have a Editmask property yet, so the dbgrid implements an event that is called for each field OnFieldEditMask, however it is disabled because TCustomMaskEdit behaves different in windows and linux when using the editmask property. To enable the feature, recompile both grids.pas and dbgrids.pas with OPT="-dEnableFieldEditMask" option it will probably work ok in windows but expect problems in linux.
-
I cant download zeosdbo_rework . Somebody has this into ftp or http? I am using Torotoise but when I try to connect I cant see the modules list>???
Please help me!!
-
Zeosdbo from cvs (zeosdbo_rework).
http://www.opinfos.com/tempo/zeos/
-
Can you throw package on server corrected package of ZEOS?
-
pleaseeeee :-)
-
Hello,
To display a numeric field as a currency field I use a DisplayFormat (€ #, ##0.00).
Sometimes (after a few updates) I get this error:
"€ 100,00" is not a valid float.
Press Ok to ignore.
Press Cancel to stop the program.
How can I solve this?
I use a recent Lazarus and ZeosDBO (with Firebird 1.5.2).
Thanks,
Edwin
-
numeric(15,2) ?
-
numeric(15,4)
-
HI all, i installed lazarus(i used delphi + zeoslib), but i have some erros, and dont letme compile and install components.:
CC:\zeosdbo_rework\src\component\ZAbstractRODataset.pas(246,15) Error: There is no method in an ancestor class to be overridden: "TZAbstractRODataset.SetFieldData(TField, Pointer, Boolean)"
C:\zeosdbo_rework\src\component\ZAbstractRODataset.pas(339,14) Error: There is no method in an ancestor class to be overridden: "TZAbstractRODataset.Lookup(const AnsiString,const Variant,const AnsiString):Variant"
C:\zeosdbo_rework\src\component\ZAbstractRODataset.pas(348,14) Error: There is no method in an ancestor class to be overridden: "TZAbstractRODataset.GetFieldData(TField, Pointer, Boolean):Boolean"
C:\zeosdbo_rework\src\component\ZAbstractRODataset.pas(352,14) Error: There is no method in an ancestor class to be overridden: "TZAbstractRODataset.UpdateStatus:<enumeration type>"
C:\zeosdbo_rework\src\component\ZAbstractRODataset.pas(382,1) Fatal: There were 4 errors compiling module, stopping
-
HI all, i installed lazarus(i used delphi + zeoslib), but i have some erros, and dont letme compile and install components.:
CC:\zeosdbo_rework\src\component\ZAbstractRODataset.pas(246,15) Error: There is no method in an ancestor class to be overridden: "TZAbstractRODataset.SetFieldData(TField, Pointer, Boolean)"
C:\zeosdbo_rework\src\component\ZAbstractRODataset.pas(339,14) Error: There is no method in an ancestor class to be overridden: "TZAbstractRODataset.Lookup(const AnsiString,const Variant,const AnsiString):Variant"
C:\zeosdbo_rework\src\component\ZAbstractRODataset.pas(348,14) Error: There is no method in an ancestor class to be overridden: "TZAbstractRODataset.GetFieldData(TField, Pointer, Boolean):Boolean"
C:\zeosdbo_rework\src\component\ZAbstractRODataset.pas(352,14) Error: There is no method in an ancestor class to be overridden: "TZAbstractRODataset.UpdateStatus:<enumeration type>"
C:\zeosdbo_rework\src\component\ZAbstractRODataset.pas(382,1) Fatal: There were 4 errors compiling module, stopping
Use the nightly release of Lazarus, and ZEOS will work OK
-
Hello,
In the latest Lazarus Snapshot (13/08) with the latest ZeosDBO the date field of a ZQuery is always shown as '30/12/1899'.
Long time ago this problem was solved but it seems to be back.
Is there a way to solve this?
Thanks,
Edwin
-
How can I create an RPM file from a Nightly Build of Lazarus to correct the problem in TZAbstractRODataset at the installation of the zcomponents?
or is there a place to download nighlty builds as rpms?
Thank you
-
I used the nightly release of lazarus from
http://www.ca.freepascal.org/Lazarus/
installing it with make but I still get the same error in TZAbstractRODataset ????
do I need the svn release?
thanks
-
Hello,
The problem with the Date field of ZQuery (always shown as '30/12/1899') still exists in the latest snapshot of Lazarus (17/08/2005). When I use an older snapshot (05/08/2005) the Date field is displayed well.
Does anybody know how to solve this (Stevie maybe)?
Thanks,
Edwin
-
This can be a problem of FPC 2.0.0. There was an issue with date fields. AFAIK it is fixed in 2.0.1
-
Hi everybody, I downloaded the daily snapshot of lazarus for windows (2005/09/21) and the last zeos_rework. When I try to compile zcore.plk I only obtain this error message
C:\Documents and Settings\ciccio\Documenti\download\Lazarus_FreePascal\Zeos\src\core\ZTokenizer.pas(1235,30) Error: Illegal type conversion: "TObject" to "<enumeration type>"
Anyone has a solution?
Thanks a lot
Marco