unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, db, sqldb, odbcconn, FileUtil, Forms, Controls, Graphics,
Dialogs, StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Label1: TLabel;
Label2: TLabel;
DataSource1: TDataSource;
ODBCConnection1: TODBCConnection;
SQLQuery1: TSQLQuery;
SQLTransaction1: TSQLTransaction;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
begin
ODBCConnection1.Close(False);
ODBCConnection1.DatabaseName:='OSCC_RET_DB';
ODBCConnection1.Open;
SQLQuery1.Close;
SQLQuery1.SQL.Text:='select count(all callid) from callrecord';
SQLQuery1.Open;
Label1.Caption:=SQLQuery1.Fields[0].AsString;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
ODBCConnection1.Close(False);
ODBCConnection1.DatabaseName:='OSCC_CCC_DB';
ODBCConnection1.Open;
SQLQuery1.Close;
SQLQuery1.SQL.Text:='select count(all callid) from callrecord';
SQLQuery1.Open;
Label2.Caption:=SQLQuery1.Fields[0].AsString;