【文件属性】:
文件名称:Delphi图书管理系统.rar
文件大小:605KB
文件格式:RAR
更新时间:2022-07-30 04:48:07
Delphi源码-数据库实例
Delphi结合数据库编写实现的图书管理系统,完成图书信息的管理维护。存在以下问题待解决:1,用sql提取表中字段,并按某字段排序
解决办法:使用order by
ASC:升序(默认方式)
DESC:降序
如:select * from t1 order by score1 DESC, score2 ASC
(有多个排序时,用“,”分开)
2,如何把用sql统计结果保存下来
解决办法:利用tquery的recordcount属性,再加条件限制(where子句)
如:
q.sql.add('select * from t1 where score1>=75 and score1<85');
q.open;
i:=q.recordcount;//得到统计结果
3.在table的beforepost中控制是否保存修改
if messagedlg('数据已经修改,保存吗?',mtconfirmation,[mbYes,mbNo],0)=mrNo then
abort;
4.遍历一个容器中的控件,并在遍历时查看它是什么类型的控件,该怎么做
for i:=0 to groupbox1.components.count-1 do
if groupbox1.components[i] is TEdit then
(groupbox1.components[i] as TEdit).text:='';
5撤消edit(dbedit,memo,dbmemo等)的修改
procedure cancelmodified(var e:TEdit);
begin
if e.modified then e.undo;
end;