Hi there,
Hopefully this is an easy one. I am trying to pass the contents of a DBLookupComboBox as a criteria in an SQL select statement but it keeps giving me the error;
'QMain: Field 'Operator' is of an unknown type'
the code I am using is;
procedure TMain.EPwordExit(Sender: TObject);
var
MySQLString : string;
Operator : string;
begin
Operator := DBLCBOpName.Text;
MySQLString := 'SELECT OperatorInfo.Pword FROM OperatorInfo WHERE OperatorInfo.Name = :Operator';
QMain.Close; //QMain is a TQuery Component.
QMain.SQL.Clear;
QMain.SQL.Add(MySQLString);
QMain.ExecSQL;
QMain.open;
QMain.first;
EAcclev.Text := QMain.Fields.Fields[0].AsString;
end;
Thanks in advance
PL
Hopefully this is an easy one. I am trying to pass the contents of a DBLookupComboBox as a criteria in an SQL select statement but it keeps giving me the error;
'QMain: Field 'Operator' is of an unknown type'
the code I am using is;
procedure TMain.EPwordExit(Sender: TObject);
var
MySQLString : string;
Operator : string;
begin
Operator := DBLCBOpName.Text;
MySQLString := 'SELECT OperatorInfo.Pword FROM OperatorInfo WHERE OperatorInfo.Name = :Operator';
QMain.Close; //QMain is a TQuery Component.
QMain.SQL.Clear;
QMain.SQL.Add(MySQLString);
QMain.ExecSQL;
QMain.open;
QMain.first;
EAcclev.Text := QMain.Fields.Fields[0].AsString;
end;
Thanks in advance
PL