Delphi基础学习笔记—指令{$R*.DFM}作用

1.{$R *.dfm}是非常重要的,在pascal中 $R指令用于加载一个外部资源文件,这一行是表示把 .dfm(代表dephi窗体)文件连接到可执行
   文件中。 其中*不代表通配符,其代表与当前单元文件同名的文件。
2.用Delphi7编写代码时出现dcc70.dll调用失败的处理方法:
   搜索“dcc70.dll”这个文件,大小为 821 KB,和 Delphi7/bin 目录下的‘dcc70.dll’文件大小一样,复制这个文件过来,把原来的‘dcc70.dll’替换掉就OK啦。之后重新启动Delphi7软件,再编写代码,一切正常,再也不出现上面的错误提示了。
3.button的快捷键设置:
  button的caption字母前面加个 & 号,比如 确定(&S) ,这样,按下ALT+S键时,就会触发这个button的click事件。
  如果你想让回车时触发这个button的click事件的话,就得自己写代码了。比如在edit1的keydown里写上 if key = #13 then   button1.click 等等,这样,当你在edit1里面填写完东西后,按下回车,这个button的click就触发了。
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Delphi 7.1 Update Release Notes=======================================================This file contains important supplemental and late-breakinginformation that may not appear in the main productdocumentation, and supersedes information contained in otherdocuments, including previously installed release notes.Borland recommends that you read this file in its entirety.NOTE: If you are updating a localized version of Delphi 7, visit the Borland Registered User web site to obtain a localized readme file that may contain important late- breaking information not included in this readme file.IMPORTANT: Delphi must be closed before installing this update. =====================================================CONTENTS * INSTALLING THIS UPDATE * UPDATING LOCALIZED VERSIONS OF DELPHI 7 * KNOWN ISSUES * ISSUES ADDRESSED BY THIS UPDATE - IDE - CORE DATABASE - DATASNAP - DBGO (ADO COMPONENTS) - dbExpress - dbExpress COMPONENTS AND DB VCL - dbExpress CORE DRIVER AND METADATA - dbExpress VENDOR ISSUES - dbExpress CERTIFICATION - WEB SNAP - ACTIVEX - COMPILER - RTL - VCL - THIRD PARTY - BOLD FOR DELPHI * VERIFYING THAT THE UPDATE WAS SUCCESSFUL * FILES INSTALLED BY THIS UPDATE =======================================================INSTALLING THIS UPDATE* This update can not be applied to Delphi 7 Architect Trial version. * This update can not be removed after it is installed.* You will need the original Delphi 7 installation CD available to install this update.* To install this update from the CD, insert the CD, and launch the d7_ent_upd1.exe file appropriate for your locale.* To install this update from the Web, double-click the self-executing installation file and follow the prompts. * The Delphi 7 documentation PDF files are available on the update CD.========================================================UPDATING LOCALIZED VERSIONS OF DELPHI 7* This update can be applied only to the English version of Delphi 7. There are separate updates for the German, French and Japanese ver
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Menus, DB, ADODB, ComCtrls; type TForm1 = class(TForm) MainMenu1: TMainMenu; N1: TMenuItem; N2: TMenuItem; N3: TMenuItem; N4: TMenuItem; N5: TMenuItem; ADOConnection1: TADOConnection; ListView1: TListView; Panel1: TPanel; Button1: TButton; Button2: TButton; DataSource1: TDataSource; ADOQuery1: TADOQuery; private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation uses Unit2; {$R *.dfm} procedure DisplayDataInListView(ListView: TListView); var Connection: TADOConnection; Query: TADOQuery; Field: TField; ListItem: TListItem; begin // 创建ADO连接和查询组件 Connection := TADOConnection.Create(nil); Query := TADOQuery.Create(nil); try // 设置连接字符串 Connection.ConnectionString := 'Provider=Microsoft.ACE.OLEDB.12.0;Data Source=G:\tongbugongju\DBSync.mdb;Persist Security Info=False;'; Connection.LoginPrompt := False; Connection.Connected := True; // 绑定连接到查询组件 Query.Connection := Connection; // 执行查询语句获取数据 Query.SQL.Text := 'SELECT * FROM tasklist'; Query.Open; // 清空ListView ListView.Clear; // 遍历查询结果并将数据显示到ListView中 while not Query.Eof do begin ListItem := ListView.Items.Add; // 遍历查询结果的字段,并将数据添加到ListItem的各列中 for Field in Query.Fields do begin ListItem.SubItems.Add(Field.AsString); end; Query.Next; end; finally // 释放资源 Query.Close; Connection.Connected := False; Connection.Free; Query.Free; end; end; end.
最新发布
07-10

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值