Recent

Author Topic: IBX 2.3-4 Fails to install  (Read 5474 times)

mobilevil

  • Jr. Member
  • **
  • Posts: 69
    • http://www.kachun.com
Re: IBX 2.3-4 Fails to install
« Reply #15 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


mobilevil

  • Jr. Member
  • **
  • Posts: 69
    • http://www.kachun.com
Re: IBX 2.3-4 Fails to install
« Reply #16 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;    

mobilevil

  • Jr. Member
  • **
  • Posts: 69
    • http://www.kachun.com
Re: IBX 2.3-4 Fails to install
« Reply #17 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.
« Last Edit: September 25, 2020, 10:57:11 am by mobilevil »

dfergfla

  • Jr. Member
  • **
  • Posts: 58
Re: IBX 2.3-4 Fails to install
« Reply #18 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.


dfergfla

  • Jr. Member
  • **
  • Posts: 58
Re: IBX 2.3-4 Fails to install
« Reply #19 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?

dfergfla

  • Jr. Member
  • **
  • Posts: 58
Re: IBX 2.3-4 Fails to install
« Reply #20 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.

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: IBX 2.3-4 Fails to install
« Reply #21 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").

dfergfla

  • Jr. Member
  • **
  • Posts: 58
Re: IBX 2.3-4 Fails to install
« Reply #22 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. 
« Last Edit: September 28, 2020, 05:21:51 am by dfergfla »

mobilevil

  • Jr. Member
  • **
  • Posts: 69
    • http://www.kachun.com
Re: IBX 2.3-4 Fails to install
« Reply #23 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.


mobilevil

  • Jr. Member
  • **
  • Posts: 69
    • http://www.kachun.com
Re: IBX 2.3-4 Fails to install
« Reply #24 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

mobilevil

  • Jr. Member
  • **
  • Posts: 69
    • http://www.kachun.com
Re: IBX 2.3-4 Fails to install
« Reply #25 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.
         

VTwin

  • Hero Member
  • *****
  • Posts: 1215
  • Former Turbo Pascal 3 user
Re: IBX 2.3-4 Fails to install
« Reply #26 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.

 
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.6 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.6 (64 bit on VBox)

 

TinyPortal © 2005-2018