我编了一段小代码,大家帮忙看看哪里出错了
procedure TForm1.CheckBox1Click(Sender: TObject);
var
s: integer;
begin
adoconnection1.Connected:=true;
adoquery1.Active:=true;
adoquery1.SQL.Add('select VHour from CardType where VPerson=:1');
s:=adoquery1.Fieldbyname('VHour').AsInteger;
adoquery1.ExecSQL;
memo1.Lines.Add(inttostr(s));
end;
运行后出现这个错误。
ADOquery1:Field 'VHour' not found
其中'select VHour from CardType where VPerson=:1'这一句没有什么问题。
procedure TForm1.CheckBox1Click(Sender: TObject);
var
s: integer;
begin
adoconnection1.Connected:=true;
adoquery1.Active:=true;
adoquery1.SQL.Add('select VHour from CardType where VPerson=:1');
s:=adoquery1.Fieldbyname('VHour').AsInteger;
adoquery1.ExecSQL;
memo1.Lines.Add(inttostr(s));
end;
运行后出现这个错误。
ADOquery1:Field 'VHour' not found
其中'select VHour from CardType where VPerson=:1'这一句没有什么问题。
解决方案 »
- Delphi TPerlregEx正则问题。
- 用代码怎么触发CalcFields事件
- 告别CSDN,谢谢几个月来兄弟们的关心,分数全部散给兄弟们~~~~~~`2
- 不规则表格的制作???
- 关于from.create、form.activate和form.close的问题
- 求救,在delphi如何把word文档保存到sql server数据库,保存后又如何取出来在word中显示其内容?
- 我的构件想扑捉vk_left等键,但不行,那为给看看
- 送份哦,网站重开张
- 怎样才能不用DBNavigator而创建自己的按钮代码?
- sql 问题
- 一道简单的sql面试题:取得工资最高员工信息,求最佳答案
- ##### 怎么把一个二进制文件转化为浮点数格式?
var
s: integer;
begin
adoconnection1.Connected:=true;
with adoquery1 do
begin
Close;
SQL.Clear;
SQL.Add('select VHour from CardType where VPerson=:1');
Open;
memo1.Lines.Add(Fieldbyname('VHour').AsString);
end;
end;
var
s: integer;
begin
adoconnection1.Connected:=true;
adoquery1.Active:=false;
adoquery1.SQL.Clear();
adoquery1.SQL.Add('select VHour from CardType where VPerson=:1');
adoquery1.Open();
s:=adoquery1.Fieldbyname('VHour').AsInteger;
memo1.Lines.Add(inttostr(s));
end; 找本基礎點的書看看吧