当我运行时,操作与Query有关的操作时,就会出现错误:
Table does not exist.File or directory not exit.我贴一段程序看看:
procedure TRentForm.ContractCodeChange(Sender: TObject);
begin
if ContractCode.Text <> '' then
begin
with SQLQuery do
begin
DatabaseName:=ExtractFilePath(Application.ExeName);
close;
SQL.Clear;
SQL.Add('select 应收日期,应收金额,实收金额,实收日期,发票号');
SQL.Add('from Rent.dbf');
SQL.Add('where 合同号= :ContractNo');
ParamByName('ContractNo').AsInteger:=strtoint(ContractCode.Text);
prepare;
Open;
end;
end;
end;
Table does not exist.File or directory not exit.我贴一段程序看看:
procedure TRentForm.ContractCodeChange(Sender: TObject);
begin
if ContractCode.Text <> '' then
begin
with SQLQuery do
begin
DatabaseName:=ExtractFilePath(Application.ExeName);
close;
SQL.Clear;
SQL.Add('select 应收日期,应收金额,实收金额,实收日期,发票号');
SQL.Add('from Rent.dbf');
SQL.Add('where 合同号= :ContractNo');
ParamByName('ContractNo').AsInteger:=strtoint(ContractCode.Text);
prepare;
Open;
end;
end;
end;
解决方案 »
- Delphi中SendMessage给一个Edit控件发送WM_SETTEXT消息的问题
- 大家用Delphi写的基于WebService的数据库大型项目运行稳定性及执行效率怎么样?
- 奇怪,fastreport2.5 不能显示‘加工’两个字?
- 应该还是个挺容易的问题吧?帮帮忙啦,挺急的~
- delphi开发asp组件的问题
- Turbo Delphi怎么注册
- 请教拷屏打印问题
- 如何在ADO的批量提交之前获得数据集中被删除的数据?200分
- Delphi提供的菜单的被选中颜色及字体的颜色如何改变?
- 请问在Webbrowser中如果复制页面的内容?
- 请问小问题!
- fastreport里的表格如何设置斜线.............
不是数据名。。
nnfish(游在Code中的鱼)
type mismatch in expression
这只是一个路径.
另外:
select * from 后面应该更的是数据库中表的名字
建议用ado,直接设置ConctionString
select * from 后面应该更的是数据库中表的名字
-----------------------------------------------------------------
我的rent.db就是表的名字啊