-3

I have problem making sql request such as

SELECT * FROM 'users' WHERE 1

using lazarus SqlQuery,SqlTransaction and MySql55Connection.But when I'm trying to open SqlQuery(

SqlQuery1.Open;

) it causes exception:

Sql statement not set.
user6012107
  • 65
  • 1
  • 9
  • 2
    https://www.google.com/#q=lazarus+sqlquery+tutorial – fantaghirocco Mar 03 '16 at 08:45
  • You have put absolutely no effort into researching this whatsoever. Stack Overflow is not a place where you come to get people to do your job for you. You need to make some actual effort. Try harder. – David Heffernan Mar 03 '16 at 10:40

1 Answers1

1

I understood my problem. I should for first set sql request and then open query and connection. Like this:

SqlQuery1.Sql.text:='SELECT FROM "users" WHERE 1'
MySql55Connection1.Open;
SqlQuery1.Open;
while not SqlQuery1.EOF
begin
  //fetch result
  SqlQuery1.Next;
end;
SqlQuery1.Close;
MySql55Connection1.Close;//Close connection
fantaghirocco
  • 4,761
  • 6
  • 38
  • 48
user6012107
  • 65
  • 1
  • 9