Lazarus

Programming => Packages and Libraries => Topic started by: dfergfla on September 20, 2020, 04:27:16 am

Title: IBX 2.3-4 Fails to install
Post by: dfergfla on September 20, 2020, 04:27:16 am
I just have to say this.  My overall frustration with Lazarus as a tool is reaching a boiling point.  Every time I turn around I have to spend hours and hours trying to work out why things don't work. 

The install for IBX is fairly straight forward.
From page 7 of the manual:

Unpack the source code archive into some suitable permanent location, as described above, and open the dclibx.lpk package description file using the Package->Open Package File menu item to open the file.  When the Package Editor opens, click on Use->Install. Lazarus will now recompile itself and restart.

I am not a stupid person so even I a total newbie can follow these directions.  But as with installing almost anything that isn't included with Lazarus by default.  It simply fails.  I am so tired and frustrated by this type of thing happening over and over and over.  I am so ready to just pay the 600.00 for Xojo.  It may be expensive but at least it works.  Yes, I know this is "open source" and people work on it in their spare time and I am grateful.  But is it too much to expect for it to work?  I'm sorry I'm being mean and bitchy.  But seriously, every day I have used this it's been one thing after an other... again and again... and again.   I have spent more hours just trying to get things working in the IDE than I have spent trying to learn how to code.

I would use Online Package Manager, but the version on there seems to be old at 2.3.0 and after installing that one, which it did install.  I got all kinds of strange errors including random "access violation" errors and absolutely nothing would compile with it.  So, I downloaded the latest version from the website 2.3.4 and can't get that one to install at all.

Windows 10 64bit.
Lazarus 2.0.10
Title: Re: IBX 2.3-4 Fails to install
Post by: dsiders on September 20, 2020, 05:39:37 am
I just have to say this.  My overall frustration with Lazarus as a tool is reaching a boiling point.  Every time I turn around I have to spend hours and hours trying to work out why things don't work. 

The install for IBX is fairly straight forward.
From page 7 of the manual:

Unpack the source code archive into some suitable permanent location, as described above, and open the dclibx.lpk package description file using the Package->Open Package File menu item to open the file.  When the Package Editor opens, click on Use->Install. Lazarus will now recompile itself and restart.

I am not a stupid person so even I a total newbie can follow these directions.  But as with installing almost anything that isn't included with Lazarus by default.  It simply fails.  I am so tired and frustrated by this type of thing happening over and over and over.  I am so ready to just pay the 600.00 for Xojo.  It may be expensive but at least it works.  Yes, I know this is "open source" and people work on it in their spare time and I am grateful.  But is it too much to expect for it to work?  I'm sorry I'm being mean and bitchy.  But seriously, every day I have used this it's been one thing after an other... again and again... and again.   I have spent more hours just trying to get things working in the IDE than I have spent trying to learn how to code.

I would use Online Package Manager, but the version on there seems to be old at 2.3.0 and after installing that one, which it did install.  I got all kinds of strange errors including random "access violation" errors and absolutely nothing would compile with it.  So, I downloaded the latest version from the website 2.3.4 and can't get that one to install at all.

Windows 10 64bit.
Lazarus 2.0.10

You're not reading the error messages.

There are two copies of the library on your system and the IDE is confused by the duplication. Remove one (or the other) entirely and the problem goes away.

Title: Re: IBX 2.3-4 Fails to install
Post by: dfergfla on September 20, 2020, 06:20:28 am
1st Thank You.

now 10 min after I got past that.  I was able to put together a very simple ibx app using the employee.fb.  When in design mode I am all connected up and I can see live data from the employee table in the grid.  then when I try to compile it I get "Transaction not active."  So, this one I am pretty sure is my fault.  So, I am off trying to figure out what this is.  I'm sure it has something to do with the transaction component.  But it is set to 'active' at design time and the documentation says (5.2.1 When set at design time will cause the transaction to be started as soon as it has loaded" so not sure what's up yet.  But again, so much of this is not written for a beginner.  I'm sure there is something missing but it doesn't seem to be in the documentation.  The only other database I have tried was an sqlight demo and that went ok.  Is this really just an IDE for former Delphi devs with years of experience?  I am really serious about this question.  I have looked at youtube for videos on this and I have found a few, but all in other languages I don't speak.  While I'm not saying there is anything at all wrong with that.  I'm just not sure what to do.  It's clear the documentation for this IBX and so many other things in Lazarus is written by developers for other developers.  I even tried something on my own.  I put BTransaction1.Active := True; into the from open even, the from activate event... nothing works.

But, I have gotten farther and learned more..  Too tired, off to bed.  I try again tomorrow.
Title: Re: IBX 2.3-4 Fails to install
Post by: mobilevil on September 20, 2020, 07:56:44 am
I am not an IBX expert but...

procedure TForm1.FormCreate(Sender: TObject);
begin
  IBDatabase1.Open;
  IBTransaction1.Active:=true;
  IBDataset1.Open;
end;     
Title: Re: IBX 2.3-4 Fails to install
Post by: zeljkoc on September 20, 2020, 09:31:00 am
maybe it will help

 IBDataSet1.AllowAutoActivateTransaction := true;     
Title: Re: IBX 2.3-4 Fails to install
Post by: dfergfla on September 21, 2020, 12:19:20 am
I want to take a moment to thank those who tried to help.  Unfortunately after an other 6 hours of trying the suggestions here, google, searching the manual.  I am still not able to actually run a very, very simple program.  With seemingly no way to find the answers I need as a beginner I am moving to Xojo.  I am disappointed.  I really wanted to learn Pascal and Lazarus.  I had tried in the past just a little here and there.  This is the  farthest I have gotten.  Lazarus and FPC are the only tools in my reach to allow me to fiddle with software on my favorite alternative platforms.  Amiga and Haiku OS.  But is not to be.  I want to state that I do not think that Lazarus or FPC are in anyway bad tools.  They just are not for beginners.  Just in case anyone is interested in my experience as a total beginner here is what I ran into.

There are just too many old examples that don't apply anymore due to changes made over the years.  But, as a newbie I had no way to know this.  So, I would fight with it and fight with it.  There is very, very little documentation geared toward teaching someone this tool.  Almost, but not all, is geared toward a person coming from Delphi who only needs to know a how Lazarus is different.  I am sure the IBX manual would be of great benefit to someone who already knew the basics of how to use databases in Lazarus.  The manual is very detailed on all the different controls and properties and what is there.  What it doesn't have is any kind of basic beginner information on how to start.   While I would never say that the developer "must" provide this it really would have been nice.  In fact I downloaded and tried IBX because there was so much documentation with it that I thought I could work with it.  The dev should be commended for going to that level for an open source project. 

My problems with trying to figure this out do not only stem from this IBX experience.  I have found that trying to venture outside of anything other than the most basic of things would result in a great deal of frustration in trying to figure them out.  The Lazarus Wiki is nice, but again is mainly written with seasoned devs in mind.  Yes, there are tutorials there, but I found a number of them outdated and subsequently do not work in Lazarus now.  Also I found some tutorials that seemed to be for newbies but some information was left out.  This made the overall experience not so good.   This is not to say I am down on Lazarus.  It is what it is.

OTH Xojo while being a commercial product has a great deal of material and such that is written to take a newbie and get them up and running.  It is updated and the examples work.  While on Lazarus a great number of the examples I tried would not.  I know that documentation and tutorials for novice programmers is extremely boring and not anyone's idea of a fun thing to do for free.  It does make it difficult for people me like to to get going.  And Lazarus is not the only open source project with this type of issue.  It is rather common in the open source world.  Documentation is boring so no one wants to do it.  Especially for free.  Then having to maintain that documentation to make sure it is still relevant with any changes to the project over time is again a boring job that doesn't really seem to get done.  It's a shame.  I would have liked to do this.

Again, thanks to everyone who tried to help.

Title: Re: IBX 2.3-4 Fails to install
Post by: mobilevil on September 21, 2020, 04:41:16 pm
I literally installed IBX and firebird after seeing your post and it was all OK, except the IBX SVN was down. the default download worked for me.

I have previous experience with IBX but it is not that hard I think. Tell us more about the problem you see things can be fixed

Welcome to the world of opensource software. Yes you are that documentation is always bad but it's the nature of software engineering. Source code is the ultimate document.
Title: Re: IBX 2.3-4 Fails to install
Post by: dfergfla on September 24, 2020, 12:24:52 am
@mobilevil

I appreciate your offer.  I am sure I am sure I am doing something wrong.  But, after over 7 hours of trying to figure it out, I have given up.  Please understand it isn't just IBX.  Everytime I try something that isn't just basic it's an uphill battle to figure it out.  As for IBX, one, just one step by step example would have been helpful.  There are at least two videos online that appear to be just that.  But neither are in English.  I tried to follow one anyway and in the Video the person clicks on the IBDatabase control and a window pops up for the database connection.  When I follow the same steps I get an error.  But, because I can't understand what is being said there is probably something I am not doing.  I'm sorry.  I'm just too frustrated with it.  I try examples, and can't get them to work.  Only to find out they are too old.  Yes, your right it is the nature of Open Source.  But, it is clear that Lazarus is only developed with experienced software developers in mind.  It's a shame Pascal has always been intended as a beginner language.  I wish it wasn't the case.  I used Turbo Pascal back in the 80's and a lot of the code is vaguely familiar.  I feel I could do well with it, but the hurdles placed in my way are more than I want to deal with.  I have been going though the https://www.xojo.com/resources/learn.php (https://www.xojo.com/resources/learn.php) and so far I find it very helpful and a relief after my experience with Lazarus.  It is clear, laid out logically and best of all, the examples work.  If something like this was available for Lazarus I would drop Xojo in a heartbeat.  But I can't spend 6,7,8 hours trying in vain to figure out something.  Like I said, one step by step walk through of an example for IBX would have probably saved me hours and hours of stress and frustration.   As for source code, yes it is the ultimate document, but only if you know the language already,  The source code does not help when you have no idea of what steps have to be done in what order.  If you never done something before the source code looks like jibberish, with no clear flow or context.
Title: Re: IBX 2.3-4 Fails to install
Post by: trev on September 24, 2020, 01:10:39 am
I have been going though the https://www.xojo.com/resources/learn.php (https://www.xojo.com/resources/learn.php) and so far I find it very helpful and a relief after my experience with Lazarus.  It is clear, laid out logically and best of all, the examples work.  If something like this was available for Lazarus I would drop Xojo in a heartbeat.

I take it you missed the FPC + Lazarus Wiki (https://wiki.freepascal.org/Main_Page) completely?
Title: Re: IBX 2.3-4 Fails to install
Post by: dfergfla on September 24, 2020, 02:41:48 am
@trev

Nope I saw it.  As I said, after I got past just the very, very basics I stared having problems making examples work.  And be honest, that Wiki is not all that good for leaning from start to finish.  As a reference it's fine.
Title: Re: IBX 2.3-4 Fails to install
Post by: trev on September 24, 2020, 04:08:29 am
Nope I saw it.  As I said, after I got past just the very, very basics I stared having problems making examples work.

I've not had any issues with the examples that I've tried. I have three law degrees and no programming qualifications, so I'm not what you call a "sesasoned dev" :)

When I've had an issue which I could not answer after having done my research, the forum has generally provided a quick solution.

Quote
  And be honest, that Wiki is not all that good for leaning from start to finish.

Actually, that IS how I used it to learn Lazarus + FPC. I had previously used Delphi 1-7 and then two decades later bought Delphi 10.1 which was just an expensive mistake, before rediscovering Lazarus + FPC which I'd used in 2007 to port my Delphi router application from Windows to macOS.

After my experience with the Wiki, I created the New Users Portal (https://wiki.lazarus.freepascal.org/Portal:New_Users) to cover the basics in one place intended to bring together the material for new users rather than leaving it scattered throughout the Wiki and more difficult to locate.

If you have any suggestions for improvements, I'm sure we'd all love to hear them.
Title: Re: IBX 2.3-4 Fails to install
Post by: dfergfla on September 24, 2020, 05:30:30 am
Quote
....Lazarus + FPC which I'd used in 2007 to port my Delphi router application from Windows to macOS.

So, you already had experience using the system that Lazarus was based on before you came here.  Thus demonstrating my point.  You used the wiki to familiarize yourself with Lazarus but already had Delphi knowledge when you got here.  I have not used Pascal or any other programming language in 30 years.  So, while you many not be a "Seasoned Developer" you did have prior experience.  As for my suggestions, I provided a link to my suggestion.  Something like that, but for Lazarus.  But it would be a lot of work for someone and that is why I don't believe it will happen.  Which is a shame, Lazarus could be such a great platform for newbie programmers.  My experience my or may not be typical.  In the end I am having a lot more success with Xojo and a great deal, I mean a great deal, less frustration.  This is just my opinion based on my personal experience with the platform. 
Title: Re: IBX 2.3-4 Fails to install
Post by: dfergfla on September 24, 2020, 05:47:05 am
Ok so here is what I need:

Using IBX and the sample employee.fdb (it could honestly be any .fdb).  Load the "Employee" table into a datagrid.  What are the steps you follow?  In what order?  What options should be set on the controls at design time.  Do you use any code to connect to the db at runtime?  If so, how and what event does that code go in?  If I can get this far I can most likely figure out a great deal more on my own.  But, I can't even get out of the gate.
Title: Re: IBX 2.3-4 Fails to install
Post by: trev on September 24, 2020, 08:31:22 am
Don't look at me - I don't do database applications. Others generously offered help above.

I was specifically asking about improvements to the Wiki for new users. You suggested a book. Well, several books do exist,  both free ones and commercial ones. See the listing at Pascal and Lazarus Books and Magazines (https://wiki.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines) on the Wiki.

There's also video tutorials for both Pascal (https://wiki.freepascal.org/Free_Pascal_videos) (eg a free university video course in Free Pascal (https://wiki.freepascal.org/Free_Pascal_videos)) and Lazarus (https://wiki.freepascal.org/Lazarus_videos) also on the Wiki.
Title: Re: IBX 2.3-4 Fails to install
Post by: dsiders on September 24, 2020, 08:23:01 pm
Ok so here is what I need:

Using IBX and the sample employee.fdb (it could honestly be any .fdb).  Load the "Employee" table into a datagrid.  What are the steps you follow?  In what order?  What options should be set on the controls at design time.  Do you use any code to connect to the db at runtime?  If so, how and what event does that code go in?  If I can get this far I can most likely figure out a great deal more on my own.  But, I can't even get out of the gate.

IBX4Lazarus is distributed with 17 example programs. One of them (employee) does EXACTLY what you're ask for.

What more do you need?
Title: Re: IBX 2.3-4 Fails to install
Post by: mobilevil on September 25, 2020, 09:43:33 am

create a new project,

create TIBDatabase, normally double clicking the IBDatabase1 should bring up Database connection editor, but it give me an error. TRegExpr exec: empty input string. A bug, OK.
so I setup DatabaseName with object inspector. I set it to "hello"
Double click the IBDatabase1 again, the database connection editor should show up correctly. browse for the database file, fill in user name and password, or even network connection if you know how to, you can click test first, or just skip to OK
I turned off LoginPrompt in object inspector.

create TIBTransaction, double click it, I like to use the "read committed" preset.
setup DefaultDAtabase to IBDatabse1 with Object inspector
Go back to IBDatabase1, set DefaultTransaction to IBTransaction1

create IBQuery, select IBDatabase1 in Database with object inspector. Right click IBQuery, select Edit SQL.
Pick the employee table, and click Generate SQL, and click OK.
set AllowAutoActivateTransaction to true with object inspector to.
You can set IBQuery to active at this point but the data won't be visible. The IBDatabase1 will prompt for login information as it is not using the saved password. I think it's a design choice made by IBX author.

Create a TDatasource from Data Access group. this thing bridge non visible data control to visible Windows controls. set it's DataSet to IBQuery1 with object inspector

Create a DBGrid, set it's DataSource property to DataSource1 with object inspector and the data is now shown

Title: Re: IBX 2.3-4 Fails to install
Post by: mobilevil on September 25, 2020, 09:59:48 am
bandage fix:
IBDatabaseEdit.pas, line 173

function TIBDatabaseEditForm.Edit: Boolean;
var
  aServerName: string;
  aDatabaseName: string;
  aProtocol: TProtocolAll;
  aPortNo: string;

begin
  if Database.DatabaseName <> '' then //add this check to fix the TRegExpr exec: empty input string error
  begin
   if ParseConnectString(Database.DatabaseName, aServerName, aDatabaseName, aProtocol, aPortNo) then
   begin
     ServerName.Text := aServerName;
     DatabasePath.Text := aDatabaseName;
     Protocol.ItemIndex := ord(aProtocol);
     PortNo.Text := aPortNo;
   end;
  end;    
Title: Re: IBX 2.3-4 Fails to install
Post by: mobilevil on September 25, 2020, 10:52:50 am
the root cause is a change in TRegExpr, which is used by FPC 3.2.0, and it affects not only IBX
https://forum.lazarus.freepascal.org/index.php?topic=51165.0

maybe we should stay with Lazarus 2.0.8 for now.
Title: Re: IBX 2.3-4 Fails to install
Post by: dfergfla on September 27, 2020, 05:17:53 pm
@dsiders

Quote
IBX4Lazarus is distributed with 17 example programs. One of them (employee) does EXACTLY what you're ask for.

What more do you need?

Yep it does, and not a single one will run without a boat load of errors.  Some will not even run at all.  How am I supposed to trust that?  As for "What more do you need?"   Oh, I don't know, how about examples that work and don't crash.

Also, the ones that do run give me a "heap" error when closed.

Again, thanks for to the people trying to help.  But, I am no further along than I was days and days ago.  Which is to say I can't even get out of the gate.

Title: Re: IBX 2.3-4 Fails to install
Post by: dfergfla on September 27, 2020, 05:20:47 pm
bandage fix:
IBDatabaseEdit.pas, line 173

function TIBDatabaseEditForm.Edit: Boolean;
var
  aServerName: string;
  aDatabaseName: string;
  aProtocol: TProtocolAll;
  aPortNo: string;

begin
  if Database.DatabaseName <> '' then //add this check to fix the TRegExpr exec: empty input string error
  begin
   if ParseConnectString(Database.DatabaseName, aServerName, aDatabaseName, aProtocol, aPortNo) then
   begin
     ServerName.Text := aServerName;
     DatabasePath.Text := aDatabaseName;
     Protocol.ItemIndex := ord(aProtocol);
     PortNo.Text := aPortNo;
   end;
  end;   

Ok, so if I understand find this code in the IBDatabasesEdit.pas.  Then I need to recompile IBX right?
Title: Re: IBX 2.3-4 Fails to install
Post by: dfergfla on September 27, 2020, 05:29:42 pm
the root cause is a change in TRegExpr, which is used by FPC 3.2.0, and it affects not only IBX
https://forum.lazarus.freepascal.org/index.php?topic=51165.0

maybe we should stay with Lazarus 2.0.8 for now.

Where can I find the download for 2.0.8?  I would like to give that a try to see if it helps.
Title: Re: IBX 2.3-4 Fails to install
Post by: trev on September 28, 2020, 03:44:59 am
Also, the ones that do run give me a "heap" error when closed.

That is not an error. Did you read it? That diagnostic is being displayed because heap checking has been turned on (and it shows there is no error - "0 unfreed memory blocks: 0").
Title: Re: IBX 2.3-4 Fails to install
Post by: dfergfla on September 28, 2020, 05:20:15 am
In the end here are the facts:

I have been using Lazarus for just over a month.  I made it though a bunch of beginner things.  Loops, setting properties, creating variables, setting values to variables... etc... all the basics.

For over a week I have been struggling with this one control.  In a whole week I am no further along with it than I was when I started.  Telling me the "Heap" is turned on does nothing to tell me where I can find this setting to turn it off.   

In less than 5 days using Xojo I have gotten more than twice as far as I have with Lazarus with a lot, lot less frustration.

Today I spent another 5 hours with the same damn control.  Did I get farther, a tiny bit.  Did it compile... well almost but nope.  Got yet another error that I can't find anywhere.... again. 

error: Default Login Dialog not found issue,  have you include the ibexpress in your program uses list?"

Again, no idea what that is.  Can't find it in the documentation.  I added the controls to the form just as everyone has told me to do.  Yet, clearly there is a step or two missing.  Steps I can't find.

This is the simplest program ever: it has an IBDatabase control, an IBTransaction control, an IBTable control, a DataSource control and a Data Grid.  That's it. 

I did manage to figure out that ibexress is a requirement to build IBX controls.  But why is it asking me about this thing at runtime?  The control is installed and Lazarus recompiled fine.  It never once complained about it and it appears that it is there.   I even opened up several of the examples and "ibexpress" is never once listed in the "uses" section... not once in any of the examples.  But the examples work, so again it is something I'm missing but don't know why, or how to fix and can't find an answer. 

I would like to ask an admin to lock/close or whatever this thread.  I am done.  I just can't fight with this anymore.  I downloaded Xojo 4 days ago and am twice as far along in learning it and being able to work with it than I have been in a month of Lazarus.  Not to mention I have not had to fight with countless errors.  It may be 600.00 but it is well worth it. 
Title: Re: IBX 2.3-4 Fails to install
Post by: mobilevil on September 28, 2020, 05:27:35 am
posting my answer to your DM here before anyone really lock this down

I saw both of your PM. Actually I think your questions should go to the forum. if you searched and can't find someone asked the same questions, your question and my answer may help someone else in the future.

first of all I use TCP, not INET. I don't know what are the differences. I just tested and both work for me.

and the password box in the database connection editor. the value actually goes to the "settings" box on the right. that's the real deal. when I played around it today I did see the password issue you mentioned but when I double checked the "settings" box, it's ok. seems the saved password is gone during the setting changes.

to do a programmatic saved password, just turn off login prompt, make sure your "settings" box has the right username and password. and as I mentioned, in design time IBX still ask you for the password. it doesn't care about the saved password in design time. I don't know why.

for the "Default Login Dialog not found issue,  have you include the ibexpress in your program uses list?" it gave you the answer already. You need to go to menu -> project -> project inspector -> add -> new requirement -> ibexpress.
or you can open your project's LPR file, it's actually the main program. add ibexpress manually in the uses line.

Title: Re: IBX 2.3-4 Fails to install
Post by: mobilevil on September 28, 2020, 05:37:32 am
and about why the IBEXPRESS requirement is only prompted in run time. I didn't check the source code but it's usually this: the code is looking for the login prompt library dynamically. it scan thought a list of installed component and see if a function pointer can be found. it's something like dynamically linked. this is why it compile fine but fail in runtime. the code didn't crash, it know what happened and gave you a hint.

in design time, the IBEXPRESS is already linked into lazarus. it is loaded in no matter if you are using it or not.

and about why the example works, I didn't read the example but I guess ibexpress is included in some unit's uses instead of the main program LPR's uses.

I don't know your background but programming is about problem solving. no matter what tool you use.
try this
https://www.quora.com/Do-expert-programmers-use-Google-frequently-when-coding
Title: Re: IBX 2.3-4 Fails to install
Post by: mobilevil on September 28, 2020, 05:47:39 am
and you said ibexpress is not included in the example.......... it is from the employee example

program project1;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Interfaces, // this includes the LCL widgetset
  Forms, Unit1, Unit2, ibexpress;

{$R *.res}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TSelectDeptDlg, SelectDeptDlg);
  Application.Run;
end.
         
Title: Re: IBX 2.3-4 Fails to install
Post by: VTwin on April 05, 2021, 08:20:02 pm
For anyone who may find this thread in a (Xojo vs Lazarus) search, I'm adding my two cents as a user of REALBasic/Real Studio from about 2005 to 2015. Caveats, things may be different in 2021 (Xojo), and I do not do databases.

I chose REALBasic as the easiest cross platform solution I could find. Over time, however, it became clear that REALBasic was not a long term solution for me. It was buggy, produced slow executables, saved binary source files, required third party add-ons, became expensive, moved to a leasing model, and required internet access to run.

Moving to Lazarus was involved, however, having used Free Pascal/Lazarus for about 6 years, I am extremely glad I did. When stuck in FreePascal/Lazarus, I have gotten much help from folks here on the forum. There are regular releases and generally quick bug fixes.

The OP found Xojo to be a a better choice, and it may be for you. For me it was not.

 
TinyPortal © 2005-2018