




已阅读5页,还剩2页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
_Delphi复习纲要implementationvar s,s1,s2:string;xop:array0.10 of string;procedure TForm1.BitBtn1Click(Sender: TObject);beginxop0:=;xop1:=;xop2:=;xop3:=;xop4:=;xop5:=;s1:=dbgrid1.Columnscombobox1.ItemIndex.FieldName+xopcombobox2.ItemIndex+edit1.Text+;if combobox3.itemindex=0 thenbegins2:=dbgrid1.Columnscombobox4.ItemIndex.FieldName+xopcombobox5.ItemIndex+edit2.Text+;adoquery1.close;adoquery1.sql.text:=select * from s where +s1+ and +s2;adoquery1.open;endelse if combobox3.itemindex=1 thenbegins2:=dbgrid1.Columnscombobox4.ItemIndex.FieldName+xopcombobox5.ItemIndex+edit2.Text+;adoquery1.close;adoquery1.sql.text:=select * from s where +s1+ or +s2;adoquery1.open;endelsebeginadoquery1.close;adoquery1.sql.text:=select * from s where +s1;adoquery1.open;end;end;procedure TForm1.ComboBox3Click(Sender: TObject);begincombobox4.Visible:=true;combobox5.Visible:=true;edit2.Visible:=true;end;end.implementationprocedure TForm2.BitBtn1Click(Sender: TObject);varff:textfile;s1,s2,s3:string;beginassignfile(ff,d:a1.txt); /新建并打开文件rewrite(ff); /Rewrite 过程能创建一个新文件并打开它;使用Reset 打开的/文本文件是只读的,使用Rewrite 和Append 打开的文本文件只能写入adoquery1.Close;adoquery1.SQL.Text:=select * from categories ;adoquery1.Open;with adoquery1 dobegin disablecontrols; first; while not eof do begin s1:=fieldbyname(categoryid).AsString; s2:=fieldbyname(categoryname).AsString; s3:=fieldbyname(description).AsString; writeln(ff,s1+ +s2+ +s3); next; end; closefile(ff); enablecontrols;end;memo1.Lines.Clear;memo1.Lines.LoadFromFile(d:a1.txt);categorypanel1.Collapsed:=false;categorypanel2.Collapsed:=true;end;procedure TForm2.BitBtn2Click(Sender: TObject);vars,s1,s2:string;nd:ttreenode;beginTreeView1.Items.Clear;adoquery1.disablecontrols;adoquery1.Close;adoquery1.SQL.Text:=select * from categories ;adoquery1.Open;while not adoquery1.Eof dobegin s:=adoquery1.FieldByName(categoryname).AsString; s1:=adoquery1.FieldByName(categoryid).AsString; ADOQuery2.Close; adoquery2.SQL.Text:=select * from products where categoryid=:s1 ; adoquery2.Parameters.ParamByName(s1).value:=s1; adoquery2.open; nd:=treeview1.Items.Add(nil,s); adoquery2.disablecontrols; adoquery2.first; while not adoquery2.Eof do begin s2:=adoquery2.FieldByName(productid).AsString+ +adoquery2.FieldByName(productname).AsString; treeview1.Items.AddChild(nd,s2); adoquery2.Next; end; adoquery2.enablecontrols; adoquery1.Next;end;adoquery1.enablecontrols;categorypanel1.Collapsed:=true;categorypanel2.Collapsed:=false;end;end.方法一:见课本P123页;利用Delphi语句和数组产生树节点procedure TForm4.FormShow(Sender: TObject);var s:string; k:integer; node:array1.3 of ttreenode;beginadoquery1.Close;adoquery1.SQL.Text:=select * from x_city order by cityid ;adoquery1.Open;while not adoquery1.Eof dobegins:=adoquery1.FieldByName(cityid).AsString+ +adoquery1.FieldByName(city).AsString;k:=adoquery1.Field
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年能源行业新能源技术应用与市场前景分析报告
- 2025工匠资格考试题库及答案
- 2025年社交电商市场行业社交电商与社交媒体研究报告
- 2025年化妆品行业品牌创新与消费需求研究报告
- 2025成人高考试题数学及答案
- 2025年注册会计师(CPA)考试 会计科目模拟试题集:实战演练提升应试能力
- 2025江苏苏州市相城招商(集团)有限公司人员招聘模拟试卷附答案详解(典型题)
- 2025广东珠海高新区科技产业局招聘合同制职员2人模拟试卷附答案详解(模拟题)
- 2025北京市朝阳区教育委员会所属事业单位招聘毕业生394人考前自测高频考点模拟试题参考答案详解
- 2025湖南凤凰县直机关事业单位选调40人模拟试卷附答案详解(考试直接用)
- 型钢混凝土结构钢筋施工
- 石群邱关源电路(第1至7单元)白底课件
- JJF 1338-2012相控阵超声探伤仪校准规范
- GB/T 40529-2021船舶与海洋技术起货绞车
- GB 31603-2015食品安全国家标准食品接触材料及制品生产通用卫生规范
- 关于公布2016年度中国电力优质工程奖评审结果的通知
- 港口集团绩效考核方案
- 送达地址确认书(诉讼类范本)
- 2023版北京协和医院重症医学科诊疗常规
- 三坐标测量基础知识(基础教育)
- 宜家战略分析(课堂PPT)
评论
0/150
提交评论