Problem ! result returned a value (not nil)

Help
2006-09-09
2013-04-02
  • Nobody/Anonymous

                MySQL := TMySQLClient.create;
                MySQL.Connect('localhost','root', 'xxx', 'xxx', 3306);
                Result:= mysql.query('SELECT `keyword`,`text` FROM `autoreply` WHERE `keyword` = ('''+GetdeviceUnicodeString(lol.xdx[1].Text)+'''))' , True, executed);
                 k:=0;
                 if k < Result.RowsCount  then
                  begin

                      ShowMessage('"" <> NIL');
                      MySQL.Free;

                  end else ;
                      ShowMessage('MATCH');
                 MySQL.Free;
                 end;

    Why every i executed this line, it always returned "Access violation at ....."

    Main goal of these line is.. to chek if a query return a result/not.. 

    FYI ... the error always point ro these line,

    ......
    if k < Result.RowsCount  then
    ......

    tnx ~

     
    • Nobody/Anonymous

      Check if result is nil and also the executed flags ;)

      if result = nil then
        begin
          showmessage('failed to execute the query');
          exit;
        end;
      if k < Result.RowsCount then
      ....

       

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks