0

I saw this post about Delphi databases. I'm in a similar situation to the OP with years of occasional use of Delphi, but never using the database features. I have both Delphi 7 and Delphi 2010, but for this purpose, I'm using Delphi 7 to add database to an existing project.

I'm trying to use Zeos Lib for connection to PostgreSQL. I followed this procedure on the Zeos BB

That process worked without error, and now the Zeos components are installed and visible in the components palette.

When trying to build the Zeos Examples projects in Delphi, I get the following results:

  • ZBlobs - cannot build - Error "Field frmMain.cbxOidAsBlob does not have a corresponding component. Remove the declaration?"

  • ZControlsExample - cannot build - error: "Field frmMain.ZQueryZ does not have a corresponding component. Remove the declaration?"

  • DbcDemo - cannot build - error: "[Error] DbcDemoMain.pas(75): Undeclared identifier: 'TStringDynArray'"

  • ZDesignTime - cannot open project - Error: "Error reading Form: Error reading qrMain.RequestLive: Property RequestLive does not exist. Ignore the error and continue? NOTE: Ignoring the error may cause components to be deleted or property values to be lost."

  • Embedded - compiles, but exception on run: "Project Embedded.exe raised exception class Exception with message None of the dynamic libraries can be found or is not loadable: Iibmysqld4l .dll, Iibmysqld.dlI Use TZConnection.LibraryLocation if the location is invalid.. Process stopped. Use Step or Run to continue."

  • ZSimple - cannot build - error: "Field frmMain.ZQueryZ does not have a corresponding component. Remove the declaration?"

It appears that the installation is incomplete, but I'm not sure what's missing. I tried to post questions to the Zeos BBS, but it appears to be in hibernation - posts have been queued for moderator.

tim11g
  • 1,935
  • 5
  • 27
  • 41
  • 1
    It sounds like you may have a Path problem - the demos all compile fine for me under D7. I suggest you remove and re-install zeos, deleting all its existing folders, and, before you recompile the packages, set their output directory to \D7\Lib2, which you'll probably need to create – MartynA Apr 01 '20 at 17:55
  • In D7 /Tools/Environment Options / Library / Library Path I have the path to Zeos: C:\.....\ZeosLib\packages\delphi7\build. In the "build" folder I find 135 Z** DCU files. I'm not sure what you mean by "output directory to \D7\Lib2. The "bpl output directory" is $(DELPHI)\Projects\Bpl, which has never needed to be changed. – tim11g Apr 02 '20 at 12:50
  • AFAIK, that output directory is global to D7. Is there another setting for project or package specific output directory? – tim11g Apr 02 '20 at 13:00
  • What I meant is set the output directory for the Zeos packages to \D7\Lib2. This is not a standard Delphi directory which is why I'm saying to use it. When you recompile the Zeos packages, the .Bpl and .Dcu files will go there. – MartynA Apr 02 '20 at 13:41
  • Currently all the DCUs are being built and are found in C:\...Delphi7ProjectsPath...\ZeosLib\packages\delphi7\build. All the BPLs are being built and are found in C:\Program Files (x86)\Borland\Delphi7\Projects\Bpl. The build directory is in the Library path. You are saying that Zeos requires me to create a new directory C:\D7\Lib2 and set the "Project Options for Z***" Output Directory to point there? – tim11g Apr 02 '20 at 14:45
  • I'm not saying Zeos **requires** anything at all. I'm just telling you the way I've always set up and used 3rd party packages in Delphi and that works fine for installing and using them. – MartynA Apr 02 '20 at 15:17
  • I started by deleting everything. Closed All in D7, removed Zeos from installed packages. Then removed Zeos lib files, and re-extracted from zeosdbo-7.2.6.1-stable.zip. I created a new lib2 directory at the same level as examples. That is, the structure for Zeos now has examples, packages, src, and lib2. I re-installed the packages one by one, and set their output directories (Project Options | Directory/Conditionals | Output Directory) to the lib2 directory. (leaving Unit, Search, and Debug to their default "build") In between each Package, I Close All and save if prompted. – tim11g Apr 02 '20 at 20:13
  • ZDbc has 21 warnings about deprecated symbols. For ZComponentDesign.dpk, have the added step of Installing the package, which is confirmed by a dialog. The new lib2 directory is added at the end of the list of the Global Library Path. – tim11g Apr 02 '20 at 20:18
  • When I open project ZSimple, I get "Error Reading Form" splMain.ExplicitWidth: Property ExplicitWidth does not exist. If I click ignore, several other similar errors occur. If I try to compile, the line "UpdateSQL.Refresh_OLD_ID_SEQ:=true;" flags Refresh_OLD_ID_SEQ as an undeclared identifier. A text search on the C: drive agrees that the string "Refresh_OLD_ID_SEQ" appears only once on that line in ZSimpleMain.pas – tim11g Apr 02 '20 at 20:28
  • My post on ZeosLib Portal was approved, and I received a response there. https://zeoslib.sourceforge.io/viewtopic.php?f=3&t=44184&p=146283#p146283 ZControlsExample will compile and run, but has an exception on libpq.dll. D7 is 32 bit, so I downloaded the non-installer binaries for the last version of Postgresql with 32 bit support and extracted that libpql.dll. It still fails with the exception " Project ZControlsExample raised and exception class Exception with message 'Client Library libpq.dll found but could not be loaded. Check compile target and library compatibility" – tim11g Apr 04 '20 at 15:33

1 Answers1

0

You didn't install the design time packages, and probably have search path issue.

Please check how you setup the Zeos library and components.

Arnaud Bouchez
  • 42,305
  • 3
  • 71
  • 159
  • Here's how I installed the design packages. from D7: File/Open/ ZComponentDesign.dpk from the Zeos delphi7 folder. /Project/Build ZComponentDesign. No errors. From the Package manager window, click Install. Dialog says package was installed. New component tab Zeos Access is created in D7 main window. It contains 14 component icons. What did I miss? See comment above on how library path is set. – tim11g Apr 02 '20 at 12:58