📄 unit8.~pas
字号:
unit Unit8;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, QRCtrls, jpeg, QuickRpt, ExtCtrls;
type
TForm8 = class(TForm)
QuickRep1: TQuickRep;
QRBand1: TQRBand;
QRLabel1: TQRLabel;
QRImage1: TQRImage;
QRShape40: TQRShape;
QRLabel14: TQRLabel;
QRLabel17: TQRLabel;
QRLabel18: TQRLabel;
QRLabel20: TQRLabel;
QRLabel21: TQRLabel;
QRLabel22: TQRLabel;
QRBand2: TQRBand;
QRShape1: TQRShape;
QRShape2: TQRShape;
QRShape3: TQRShape;
QRLabel3: TQRLabel;
QRShape4: TQRShape;
QRShape5: TQRShape;
QRShape7: TQRShape;
QRLabel2: TQRLabel;
QRLabel4: TQRLabel;
QRShape8: TQRShape;
QRShape10: TQRShape;
QRShape13: TQRShape;
QRShape15: TQRShape;
QRShape16: TQRShape;
QRLabel6: TQRLabel;
QRShape18: TQRShape;
QRShape20: TQRShape;
QRShape22: TQRShape;
QRLabel8: TQRLabel;
QRLabel9: TQRLabel;
QRLabel10: TQRLabel;
QRLabel5: TQRLabel;
QRLabel15: TQRLabel;
QRLabel16: TQRLabel;
QRBand3: TQRBand;
QRDBText1: TQRDBText;
QRShape9: TQRShape;
QRShape11: TQRShape;
QRShape12: TQRShape;
QRShape14: TQRShape;
QRShape17: TQRShape;
QRShape19: TQRShape;
QRShape21: TQRShape;
QRShape23: TQRShape;
QRDBText3: TQRDBText;
QRDBText4: TQRDBText;
QRBand4: TQRBand;
QRShape24: TQRShape;
QRShape25: TQRShape;
QRShape27: TQRShape;
QRShape28: TQRShape;
QRShape29: TQRShape;
QRLabel7: TQRLabel;
QRLabel11: TQRLabel;
QRLabel12: TQRLabel;
QRLabel13: TQRLabel;
QRShape30: TQRShape;
QRShape32: TQRShape;
QRShape33: TQRShape;
QRShape34: TQRShape;
QRShape35: TQRShape;
QRShape38: TQRShape;
QRShape31: TQRShape;
QRLabel19: TQRLabel;
QRShape42: TQRShape;
QRShape6: TQRShape;
QRShape26: TQRShape;
QRRichText1: TQRRichText;
ADOConnection1: TADOConnection;
ADOQuery1: TADOQuery;
ADOQuery2: TADOQuery;
QRShape36: TQRShape;
QRShape39: TQRShape;
QRLabel23: TQRLabel;
QRLabel25: TQRLabel;
QRDBText2: TQRDBText;
QRDBText5: TQRDBText;
QRDBText6: TQRDBText;
QRShape41: TQRShape;
QRShape43: TQRShape;
QRLabel26: TQRLabel;
QRLabel27: TQRLabel;
QRLabel28: TQRLabel;
QRLabel29: TQRLabel;
QRLabel30: TQRLabel;
QRLabel33: TQRLabel;
QRLabel34: TQRLabel;
QRLabel35: TQRLabel;
QRLabel36: TQRLabel;
QRLabel32: TQRLabel;
QRLabel31: TQRLabel;
QRLabel37: TQRLabel;
QRDBText8: TQRDBText;
QRLabel24: TQRLabel;
function ConnectDataBase():boolean;
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form8: TForm8;
implementation
{$R *.dfm}
function TForm8.ConnectDataBase():boolean;
var
Constr:string;
begin
ADOConnection1.Close;
try
Constr:='Provider=Microsoft.Jet.OLEDB.4.0;Password="";User ID=admin;';
Constr:=Constr+'Data Source='+ExtractFilePath(Application.ExeName)+'database\ZD.mdb;Mode=ReadWrite';
ADOConnection1.ConnectionString := Constr;
ADOConnection1.Connected:=true;
result:=true;
except
result:=false;
application.MessageBox('连接数据库失败','提示',1);
end;
end;
procedure TForm8.FormShow(Sender: TObject);
begin
ConnectDataBase;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -