X
xuesan
Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DB, ADODB;
type
TForm1 = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Label2: TLabel;
Edit2: TEdit;
Label3: TLabel;
Edit3: TEdit;
Label4: TLabel;
Edit4: TEdit;
Label5: TLabel;
Edit5: TEdit;
Label6: TLabel;
Edit6: TEdit;
Label7: TLabel;
Edit7: TEdit;
Label8: TLabel;
Edit8: TEdit;
Label9: TLabel;
Edit9: TEdit;
Label10: TLabel;
Edit10: TEdit;
Label11: TLabel;
Edit11: TEdit;
Label12: TLabel;
Edit12: TEdit;
Label13: TLabel;
Edit13: TEdit;
Label14: TLabel;
Memo1: TMemo;
Label15: TLabel;
Memo2: TMemo;
Button1: TButton;
ADOConnection1: TADOConnection;
ADOQuery1: TADOQuery;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
try
with adoquery1 do
begin
close;
sql.Clear;
sql.Add('insert user values 用户名,:公司名称,:联系人,:电话和传真,:电子邮箱,:OICQ,:详细地址,:会员开始时间,:会员到期时间,:操作时间,:本站使用的服务,:备注说明,:每年总费用,:年利润,:总利润,:用户ID');
Parameters.ParamByName('用户ID').Value:=trim(edit1.Text);
Parameters.ParamByName('用户名').Value:=trim(edit2.Text);
Parameters.ParamByName('公司名称').Value:=trim(edit3.Text);
parameters.ParamByName('联系人').value:=trim(edit4.text);
parameters.ParamByName('电话和传真').Value:=trim(edit5.text);
parameters.parambyname('电子邮箱').value:=trim(edit6.text);
parameters.ParamByName('OICQ').Value:=trim(edit7.text);
parameters.parambyname('详细地址').value:=trim(edit8.text);
parameters.parambyname('会员开始时间').value:=trim(edit9.text);
parameters.parambyname('会员到期时间').value:=trim(edit10.text);
parameters.parambyname('每年总费用').value:=trim(edit11.text);
parameters.parambyname('年利润').value:=trim(edit12.text);
parameters.parambyname('总利润').value:=trim(edit13.text);
parameters.parambyname('本站使用的服务').value:=trim(memo1.text);
parameters.parambyname('备注说明').value:=trim(memo2.text);
parameters.parambyname('操作时间').value:=now();
execsql;
showmessage('添加成功!');
end;
except
showmessage('添加失败!');
end;
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DB, ADODB;
type
TForm1 = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Label2: TLabel;
Edit2: TEdit;
Label3: TLabel;
Edit3: TEdit;
Label4: TLabel;
Edit4: TEdit;
Label5: TLabel;
Edit5: TEdit;
Label6: TLabel;
Edit6: TEdit;
Label7: TLabel;
Edit7: TEdit;
Label8: TLabel;
Edit8: TEdit;
Label9: TLabel;
Edit9: TEdit;
Label10: TLabel;
Edit10: TEdit;
Label11: TLabel;
Edit11: TEdit;
Label12: TLabel;
Edit12: TEdit;
Label13: TLabel;
Edit13: TEdit;
Label14: TLabel;
Memo1: TMemo;
Label15: TLabel;
Memo2: TMemo;
Button1: TButton;
ADOConnection1: TADOConnection;
ADOQuery1: TADOQuery;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
try
with adoquery1 do
begin
close;
sql.Clear;
sql.Add('insert user values 用户名,:公司名称,:联系人,:电话和传真,:电子邮箱,:OICQ,:详细地址,:会员开始时间,:会员到期时间,:操作时间,:本站使用的服务,:备注说明,:每年总费用,:年利润,:总利润,:用户ID');
Parameters.ParamByName('用户ID').Value:=trim(edit1.Text);
Parameters.ParamByName('用户名').Value:=trim(edit2.Text);
Parameters.ParamByName('公司名称').Value:=trim(edit3.Text);
parameters.ParamByName('联系人').value:=trim(edit4.text);
parameters.ParamByName('电话和传真').Value:=trim(edit5.text);
parameters.parambyname('电子邮箱').value:=trim(edit6.text);
parameters.ParamByName('OICQ').Value:=trim(edit7.text);
parameters.parambyname('详细地址').value:=trim(edit8.text);
parameters.parambyname('会员开始时间').value:=trim(edit9.text);
parameters.parambyname('会员到期时间').value:=trim(edit10.text);
parameters.parambyname('每年总费用').value:=trim(edit11.text);
parameters.parambyname('年利润').value:=trim(edit12.text);
parameters.parambyname('总利润').value:=trim(edit13.text);
parameters.parambyname('本站使用的服务').value:=trim(memo1.text);
parameters.parambyname('备注说明').value:=trim(memo2.text);
parameters.parambyname('操作时间').value:=now();
execsql;
showmessage('添加成功!');
end;
except
showmessage('添加失败!');
end;
end;
end.