if radiobutton1.Checked then 运行时错误指到这一行
gxstring:='or';
if radiobutton2.Checked then
gxstring:='and';
...........
if (edit2.Text <>'')and (edit1.Text='') then
query1.SQL.Add(' xm='''+edit2.Text+'''')
else if (edit2.Text <>'')and (edit1.Text<>'') then
query1.sql.Add(gxstring+' xm='''+edit2.Text+'''');
我想把and 和or 动态的赋给gxstring,运行时出错,请大家帮忙看看错在哪里
gxstring:='or';
if radiobutton2.Checked then
gxstring:='and';
...........
if (edit2.Text <>'')and (edit1.Text='') then
query1.SQL.Add(' xm='''+edit2.Text+'''')
else if (edit2.Text <>'')and (edit1.Text<>'') then
query1.sql.Add(gxstring+' xm='''+edit2.Text+'''');
我想把and 和or 动态的赋给gxstring,运行时出错,请大家帮忙看看错在哪里
gxstring:='and';-->gxstring:=' and ';
是不是没空格?
if listbox1.SelCount=0 then
begin
showmessage(‘请选择输出项’);
exit;
end;
s:=table1.Lookup('bmmc',combobox2.items.strings[combobox2.itemindex],'bmh');
if radiobutton1.Checked then
gxstring:='or';
if radiobutton2.Checked then
gxstring:='and';
var
V: Variant;
A: String;
begin
V := Table1.Lookup('State', 'OR', 'Addr1');
if not (VarType(V) in [varNull]) then
begin
A := V;
ShowMessage(A);
end
else
ShowMessage('Search unsuccessful!');end;