variables - Parameter has no default value, SQL Query doesn't work -


  Select from the candidate where the candidate. User Name = Current User  

The current user is a global variable (string) that gets the username from the login when I try to use SQLQuery with a TDBGrid error , The current user does not have any default values ​​for the parameter.

  Unit Univerver; Current Var user: string; End of implementation  

The code for the global variable.

Current Users: = ADUSIR. Text; The code, when the user has the value.

You can use this code:

  ADOQuery1. SQL.Clear (); ADOctria1SQL.ed (select from "Selector"); ADOQuery1.SQL.Add ('WHERE candidate username:: CurrUser'); Adictoria 1. Parameter. Parmabanam ('crusher'). Value: = Current user; ADOQuery1.Open;  

Comments