Recent

Author Topic: External: SIGSEGV error  (Read 1047 times)

Conte

  • New Member
  • *
  • Posts: 27
External: SIGSEGV error
« on: September 24, 2021, 11:04:28 pm »
I have a form and a datamodule.
I am making a connection to a local oracle db and showing the result to a dbgrid.
I am using Zeos connection.
When I compile i have no errors, when I run a "select" i have this error back:

(https://i.postimg.cc/J0HfCn8f/Cattura.png)



Is the problem oracle? I have switched to Lazarus to enjoy zeos connection cause on Delphi community I don't have oracle driver for free. A good reason to know lazarus but on Delphi it was working  %)

This is the code:
Code: Pascal  [Select][+][-]
  1. unit form1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, DBGrids, StdCtrls,
  9.   datamodule1;
  10.  
  11. type
  12.  
  13.   { TLogin }
  14.  
  15.   TLogin = class(TForm)
  16.     Button1: TButton;
  17.     DBGrid1: TDBGrid;
  18.     procedure Button1Click(Sender: TObject);
  19.   private
  20.  
  21.   public
  22.  
  23.   end;
  24.  
  25. var
  26.   Login: TLogin;
  27.  
  28. implementation
  29.  
  30. {$R *.lfm}
  31.  
  32. { TLogin }
  33.  
  34.  
  35.  
  36. procedure TLogin.Button1Click(Sender: TObject);
  37. begin
  38.    oraclemng.ZQuery1.sql.Add('select * from help');
  39.    oraclemng.zquery1.open;
  40. end;
  41.  
  42. end.
  43.  

This is the line going in error:
oraclemng.ZQuery1.sql.Add('select * from help');
oraclemng.zquery1.open;


[Edited to fix the code tags - please read How to use the Forum.]
« Last Edit: September 25, 2021, 08:47:27 am by trev »

loaded

  • Sr. Member
  • ****
  • Posts: 318
Re: External: SIGSEGV error
« Reply #1 on: September 25, 2021, 09:21:07 am »
I think that your query structure will be similar to this one, and it will help you overcome some problems.

Code: Pascal  [Select][+][-]
  1.   if ZConnection1.Connected then
  2.   begin
  3.     try
  4.       ZQuery1.SQL.Clear;
  5.       ZQuery1.SQL.Add('select * from help');
  6.       Zquery1.ExecSQL;
  7.     except
  8.       on E: Exception do  ShowMessage(E.ClassName+' --> Error :  '+E.Message);
  9.     end;
  10.   end
  11.   else
  12.   begin
  13.   Showmessage('Database Not Connected');
  14.   end;
Lazarus V2.0.10 32 Bit + Intel I5 8250U + 12GB RAM + Win 10 Home 64 Bit = red pill
Morpheus: "You take the blue pill...the story ends, you wake up in your bed and believe whatever you want to believe. You take the red pill...you stay in Wonderland, and I show you how deep the rabbit hole goes."

Conte

  • New Member
  • *
  • Posts: 27
Re: External: SIGSEGV error
« Reply #2 on: September 26, 2021, 06:18:24 pm »
Solved adding Application.CreateForm(TDataModule1, DataModule1); in the project lpr file.

 

TinyPortal © 2005-2018