1 请问下面的话是什么意思,可能是那里出了问题,请指教!
Project Project1.exe raised exception class EDBEEngine Error With Message 'Invalid use of KeyWord ,Token:姓名=‘张学有‘
Line Number:1'process stopped Use Step or run to continue我做的数据库以姓名为主键,以上情况是我在作了一个查询按钮后发生的情况
2 代码如下:procedure TJYQuery.FormCreate(Sender:TObject);begin
with XTQuery do
begin
close;
sql.clear;
sql.ADD('select 姓名,部别,文化程度,毕业院校 from xt');
open;
end;
s:='select 姓名,部别,文化程度,毕业院校 from xt';
activecontrol:=Name;
end;
procedure TJYQuery.Button2Click(Sender: TObject);
begin
s:='select 姓名,部别,文化程度,毕业院校,from xt'; if Name.text<>''then
begin s:=s+'where 姓名='''+Name.Text+'''';
end;
with XTQuery do
begin
close;
sql.Clear;
sql.Add(s);
try
open;
except
execsql;//请问这个是什么意思
end;
end;end;
procedure TJYQuery.Button3Click(Sender: TObject);
begin
XGForm:=TXGForm.Create(self);
XGForm.ShowModal;end;end.
Project Project1.exe raised exception class EDBEEngine Error With Message 'Invalid use of KeyWord ,Token:姓名=‘张学有‘
Line Number:1'process stopped Use Step or run to continue我做的数据库以姓名为主键,以上情况是我在作了一个查询按钮后发生的情况
2 代码如下:procedure TJYQuery.FormCreate(Sender:TObject);begin
with XTQuery do
begin
close;
sql.clear;
sql.ADD('select 姓名,部别,文化程度,毕业院校 from xt');
open;
end;
s:='select 姓名,部别,文化程度,毕业院校 from xt';
activecontrol:=Name;
end;
procedure TJYQuery.Button2Click(Sender: TObject);
begin
s:='select 姓名,部别,文化程度,毕业院校,from xt'; if Name.text<>''then
begin s:=s+'where 姓名='''+Name.Text+'''';
end;
with XTQuery do
begin
close;
sql.Clear;
sql.Add(s);
try
open;
except
execsql;//请问这个是什么意思
end;
end;end;
procedure TJYQuery.Button3Click(Sender: TObject);
begin
XGForm:=TXGForm.Create(self);
XGForm.ShowModal;end;end.
解决方案 »
- 怎么监控数据库中数据的变化?
- 回报广大CSDN Delphi版的朋友!请进
- access数据库建立和多表查询,在线等。多谢
- 怎么实现ACCESS数据库C/S开发,能给个源码吗,
- 播放MIDI音乐的问题
- 请教怎么设置TActionClientItem组件?
- 请试用我的图标制作软件!
- 往oracle中插數據時請教怎麼改寫; to_date('2002/07/26 07:40','YYYY/MM/DD hh:nn:ss') ,誰幫我改寫???
- 急聘!!研发工程师、维护服务工程师(西安、成都、上海),08年10月31号前有效
- 拉登死了?下一个将是谁呢?
- 我想发布我的一个软件。
- 我做了一个下载程序,请问如何在程序中限制下载速度?
数据库没做过,记得好像是这样,有不对的,高手更正
insert, delete, update 用execsql改成:
s:='select 姓名,部别,文化程度,毕业院校 from xt';
if Name.text<>''then
begin
s := s+Format(' where 姓名=%s', [Name.Text]);
end;
试试.
open 是针对有数据返回的查询比如select
execsql 是针对没有数据返回的比如:delete ,insert,update.
s:=s+' where 姓名='''+Name.Text+'''';//////在WHERE前加一个空格