首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

急求大家了!帮帮忙!

2012-03-02 
急啊!!!!求大家了!!!帮帮忙!!!!在线等!!!!dm.ADOQueryFlg.SQL.Text: selectflgfrominformationwhere学级

急啊!!!!求大家了!!!帮帮忙!!!!在线等!!!!
dm.ADOQueryFlg.SQL.Text:= 'select   flg   from   information   where   学级   =   ' ' '+txtgrade.Text+ ' ' ',专业   =   ' ' '+txtdep.Text+ ' ' ',班级   =   ' ' '+txtclass.Text+ ' ' ' ';
        edit1.Text:=   dm.ADOQueryFlg.FieldValues[ 'flg '];
运行时他非说我flg字段找不到!!!可是我information表里有这个字段!!!为什么啊???!!!
dm   为DataModule

[解决办法]
首先,你的sql不正确
其次,你的ADOQueryFlg open了没

dm.ADOQueryFlg.SQL.Text:= 'select flg from information where 学级 = ' ' '+txtgrade.Text+ ' ' ' and 专业 = ' ' '+txtdep.Text+ ' ' ' and 班级 = ' ' '+txtclass.Text+ ' ' ' ';
dm.ADOQueryFlg.Open;
edit1.Text:= dm.ADOQueryFlg.FieldValues[ 'flg '];

[解决办法]
select ,...查询的方法就得有返回结果.所以要用open 如果是执行数据修改新增删除操作,就只能用 execsql

热点排行