提交 8d0a10fe 编写于 作者: cz_012273's avatar cz_012273

上传新文件

上级 cc6c47f4
unit ChaXun;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, FireDAC.Stan.Intf,
FireDAC.Stan.Option, FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS,
FireDAC.Phys.Intf, FireDAC.DApt.Intf, FireDAC.Stan.Async, FireDAC.DApt,
FireDAC.UI.Intf, FireDAC.Stan.Def, FireDAC.Stan.Pool, FireDAC.Phys,
FireDAC.Phys.SQLite, FireDAC.Phys.SQLiteDef, FireDAC.Stan.ExprFuncs,
FireDAC.Phys.SQLiteWrapper.Stat, FireDAC.VCLUI.Wait, Vcl.Mask, Vcl.DBCtrls,
Data.DB, FireDAC.Comp.Client, FireDAC.Comp.DataSet, Vcl.ExtCtrls, Vcl.Grids,
Vcl.DBGrids;
type
TForm4 = class(TForm)
Label1: TLabel;
FDQuery1: TFDQuery;
FDConnection1: TFDConnection;
DataSource1: TDataSource;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Button1: TButton;
Button2: TButton;
DBGrid1: TDBGrid;
DBText1: TDBText;
DBText2: TDBText;
DBText3: TDBText;
DBText4: TDBText;
DBText5: TDBText;
DBText6: TDBText;
DBText7: TDBText;
Label8: TLabel;
DBText8: TDBText;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form4: TForm4;
implementation
uses pubunit;
{$R *.dfm}
procedure TForm4.Button1Click(Sender: TObject);
begin
close;
end;
procedure TForm4.Button2Click(Sender: TObject);
begin
close;
end;
procedure TForm4.FormShow(Sender: TObject);
begin
FDConnection1.Params.Add('Database=' + dbName);
FDConnection1.Connected := True;
with FDQuery1 do
begin
Close;
Open('SELECT * FROM 库存表');
Fields[0].DisplayWidth := 4; //这个宽度指字符数
Fields[1].DisplayWidth := 20;
Fields[2].DisplayWidth := 6;
Fields[3].DisplayWidth := 6;
Fields[4].DisplayWidth := 10;
Fields[5].DisplayWidth := 6;
end;
end;
end.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册