Real-Time SQL Query lazarus / 16-Databases ---------------------------------------------------------------------- j0x · 2011-12-25 04:55 after successfully connecting to the postgresql via psqlODBC -> http://www.lazarus.freepascal.org/index.php/topic,15603.0.html i encountered another problem that says "SQLQuery1: Parameter "lname" not found. this is the code Quote   sqlQuery1.Close;    sqlQuery1.SQL.Text:= 'select * from hrms.emppersonal where lname like :lname%';    sqlQuery1.Params.ParamByName('lname').AsString := Trim(AnsiUpperCase(txtLname.Text));    odbcConnect.Open;    sqlTransaction1.Active := True;    sqlQuery1.Open;  and also what can i do to make a real time query? i mean is while i enter texts on a textbox it will do the SQL query to be displayed in the DBGrid at the same time, just like when searching on google for words then google will automatically display the answers/results according to what you currently type thanks! ---------------------------------------------------------------------- 99Percent · 2011-12-25 07:35 Code: [Select]sqlQuery1.SQL.Text:= 'select * from hrms.emppersonal where lname like :lname%'; should be: Code: [Select]qlQuery1.SQL.Text:= 'select * from hrms.emppersonal where lname like :lname||''%'''; note double single quotes. Lately I have tended to forgo parameters completely in my code. The convenience just ins't worthwhile. So in your case I would just do: Code: [Select]sqlQuery1.SQL.Text:='select * from hrms.emppersonal where lname like '''+Trim(AnsiUpperCase(txtLname.Text))+'%''';For "real time queries" you will need a TTimer component. ---------------------------------------------------------------------- j0x · 2011-12-25 13:33 @99percent thanks a lot your last code is more simplier and working although i have a hard time understanding when/how to properly put double quotes though and how can a TTimer help with the real-time query im asking? can you give me some more code/tips? ---------------------------------------------------------------------- j0x · 2011-12-26 09:13 @99Percent i tested your tips of using TTimer that has interval of 0.5 seconds and this is the entire code Quoteprocedure TfrmTestDB.Timer1Timer(Sender: TObject); begin    with odbcConnect do begin     Driver   := 'PostgreSQL UNICODE';     UserName := trim(txtUserName.Text);     Password := '';     Params.Add('Server=' + trim(txtServer.Text));     Params.Add('PORT=5432');     Params.Add('DATABASE=' + trim(txtDatabase.Text));   end;    sqlQuery1.Close;    sqlQuery1.SQL.Text:='select * from hrms.emppersonal where lname like '''+Trim(AnsiUpperCase(txtLname.Text))+'%''';    odbcConnect.Open;    sqlTransaction1.Active := True;    sqlQuery1.Open;    Timer1.Enabled := False; end; procedure TfrmTestDB.txtLnameKeyDown(Sender: TObject; var Key: Word;   Shift: TShiftState); begin   if Key = 13 then Timer1.Enabled := True; end; procedure TfrmTestDB.txtLnameKeyPress(Sender: TObject; var Key: char); begin   if Not (Key in ['A'..'Z','a'..'z',#8..#13]) then Key := #0; end;        its working good now, thanks!!!