我在查询按钮里有这样一段代码:
T_person.Filter:='ID='''+i_name.Text+'''';
T_person.Filtered:=true;
T_person.Open;
if T_person.RecordCount=1 then
begin
Q_person.Close;
Q_person.ClearFields;
Q_person.sql.Add('select id,name,address,tel from'+
'person where name='''+i_name.text+'''');
Q_person.Open;
i_id.Text:=Q_person['id'];
i_address.Text:=Q_person['address'];
i_tel.Text:=Q_person['tel'];
Q_person.Close;
Q_person.ClearFields;
end;
编译的时候,系统总是提示 sql 语句有问题,我在sql server 里测试该语句
都没有问题呀!不知问题处在那里?还请各位仁兄帮忙?
T_person.Filter:='ID='''+i_name.Text+'''';
T_person.Filtered:=true;
T_person.Open;
if T_person.RecordCount=1 then
begin
Q_person.Close;
Q_person.ClearFields;
Q_person.sql.Add('select id,name,address,tel from'+
'person where name='''+i_name.text+'''');
Q_person.Open;
i_id.Text:=Q_person['id'];
i_address.Text:=Q_person['address'];
i_tel.Text:=Q_person['tel'];
Q_person.Close;
Q_person.ClearFields;
end;
编译的时候,系统总是提示 sql 语句有问题,我在sql server 里测试该语句
都没有问题呀!不知问题处在那里?还请各位仁兄帮忙?
解决方案 »
- MainMenu放置到ToolBar中时自动AutoHotkey
- Delphi中如何在edit中显示查询到的列表中某一项数值?
- 进来看一下吧!也许你懂
- temptable:TTable 中,temptable表他们的列名怎么用中文显示出来
- FastReport中的frPrintGrid组件的Title为什么总是竖排,怎么横过来,怎样加页码和页数
- 请问如何释放Image中的内容(要释放后Image还能使用)。
- 如何清空动态数组,并将其长度变为刚定义未设置setlength()时的长度?
- ADO的发布问题,请帮忙
- 有人在多线程的Delphi程序中使用过COM吗?
- tikkypeng(千两狂死郎)在不在!!!???
- ◎◎◎◎出错了!求教了!帮忙了!给分了!◎◎◎◎
- 怎样用delphi编辑用MS-SQL做的数据库?
with Q_person do
begin
Close ;
sql.Add('select id,name,address,tel from'+
'person where name='''+i_name.text+'''');
Open;
i_id.Text := FieldByName('id').AsString; //
...
Close;
end;
end;
'person where name='''+i_name.text+'''');
--------------------------------------------Sql.Text := 'select id,name,address,tel from person where name = '''
+ I_Name.Text + '''' ;