变量问题(50)

  • 主题发起人 wisdomphg
  • 开始时间
W

wisdomphg

Unregistered / Unconfirmed
GUEST, unregistred user!
varn:string;beginn:='ehw_gx08';ADOQuery6.close; ADOQuery6.sql.clear; ADOQuery6.sql.add('Update ehwaa set '''+n+'''=''1'' where ehw_xh=''2099-M3'' '); ADOQuery6.ExecSQL ;为什么变量n用不了
 
改为ADOQuery6.sql.add('Update ehwaa set ' + n + ' = ''1'' where ehw_xh = ''2099-M3'' ');试试。
 
ADOQuery6.sql.add('Update ehwaa set '''+n+'''=''1'' where ehw_xh=''2099-M3'' ');你这么写肯定是不对的。
 
ADOQuery6.sql.add('Update ehwaa set '+n+'=''1'' where ehw_xh=''2099-M3'' ');
 

Similar threads

S
回复
0
查看
950
SUNSTONE的Delphi笔记
S
S
回复
0
查看
1K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
745
SUNSTONE的Delphi笔记
S
S
回复
0
查看
772
SUNSTONE的Delphi笔记
S
S
回复
0
查看
927
SUNSTONE的Delphi笔记
S
顶部