⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit7.~pas

📁 这是本人网络数据库实习的程序,编程语言选择DELPHI7.0,完全个人编写.本程序一些界面还不够完善,功能不大,还有很多地方需要改进,望有兴趣的朋友一起探讨或通过电子邮箱与我联系!
💻 ~PAS
字号:
unit Unit7;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, jpeg, ExtCtrls, DB, ADODB, Grids, DBGrids;

type
  Tmoddel = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    DBGrid1: TDBGrid;
    DataSource1: TDataSource;
    ADOTable1: TADOTable;
    Label3: TLabel;
    Label7: TLabel;
    Edit1: TEdit;
    ComboBox2: TComboBox;
    Button4: TButton;
    Button5: TButton;
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  moddel: Tmoddel;

implementation
   uses unit3, Unit2,unit1;
{$R *.dfm}

procedure Tmoddel.Button3Click(Sender: TObject);
begin
  moddel.Close ;
  main.ADOquery1.SQL.Clear;
  main.ADOQuery1.SQL.Add('select * from 报刊信息');
  main.ADOQuery1.Open; 
end;

procedure Tmoddel.Button2Click(Sender: TObject);
begin
  if application.MessageBox('确定删除吗?','操作提示',1)=1 then
    main.ADOQuery1.Delete;
end;



procedure Tmoddel.Button1Click(Sender: TObject);
begin
  if application.MessageBox('确定修改吗?','操作提示',1)=1 then
    begin
    main.ADOQuery1.Edit;
    main.ADOQuery1.Post;
    end;
end;

procedure Tmoddel.Button4Click(Sender: TObject);
begin
  with main.adoquery1 do
    begin
    sql.Clear;
    sql.Add('select * from 报刊信息');
    sql.Add(format(' where (%s',[trim(combobox2.Text)]));
    sql.Add(format(' = ''%s'')',[trim(edit1.Text)]));
    open;
    end;
  if main.ADOQuery1.RecordCount<1 then
    showmessage('无此报刊!请确认是否输入正确!');
end;

procedure Tmoddel.Button5Click(Sender: TObject);
begin
   with main.adoquery1 do
    begin
    sql.Clear;
    sql.Add('select * from 报刊信息');
    open;
    end;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -