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 ~
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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 ~
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
....