菜鸟级问题 (50分)

K

kenhom

Unregistered / Unconfirmed
GUEST, unregistred user!
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
strSQL:='select * from users where users="'+edit1.Text+'"';
ADOQuery1.SQL.Add(strSQL);
ADOQuery1.Open;

当edit1.text输入数据时 比如 test
报错 列名'test'无效
什么原因阿??
 
你吧strSQL打出来看一下,不就能发现了吗
 
>>strSQL:='select * from users where users="'+edit1.Text+'"';
strSQL:='select * from users where users='+''''+edit1.Text+'''';
 
strSQL:='select * from users where users="'+edit1.Text+'"';
这样写不对吧
strSQL:='select * from users where users=''+edit1.Text+''';
 
strSQL:='select * from users where users='''+edit1.Text+'''';
 
顶部