[lazarus] ANSISTRING expected TSTRINGS (trouble)

marius popa mapopa at reea.net
Sun Aug 25 16:23:52 EDT 2002


i want to run next code (create a Tstrings and then transmit it to a query )
  tmpquery := TFIBQuery.Create(Self);
  mysql:=Tstrings.Create();
  mysql:='Select * from employee';     (*this is the line 152*)
  tmpquery.SetSQL(mysql);

and this error kill me !!

gtkfireadmin_main_form.pp(152,10) Error: Incompatible types: got "ANSISTRING" expected "TSTRINGS"

but if i put this way (like in delphi )

  tmpquery := TFIBQuery.Create(Self);
  mysql:=Tstrings.Create();
  mysql.add('Select * from employee');
  tmpquery.SetSQL(mysql);
  
then the program compiles ok but if i run the code (ex when i push a button)
the i have an AV (An unhandled exception occurred at 0x080BDFAC :
Abstract method called
  0x080BDFAC
  0xBFFFE988  main,  line 13 of graphics.pp)


Shure the same line is the problem
if comment the line
//   mysql.add('Select * from employee');
and the next one the AV disapear ...







More information about the Lazarus mailing list