Delphi进销存系统的设计与实现 第17页

theRect:=Rect(label1.left,label1.Top,edit1.Left+edit1.Width,button1.Top+button1.Height);

 //座标换算

 MapWindowPoints(handle,0,theRect,2);

 ClipCursor(@theRect);

 

3)充分利用SQL SERVER提供的存储过程,提高数据的处理能力。

  ①利用存储过程产生获取数据库任意表中的编号

CREATE proc getIdent

 @tableName char(20),

 @tableMaxId int output

as

 select @tableMaxId=ident_current(@tableName)+1

GO

以产生客户编号为例:

 select @Code='C'+Cast(@Mid As char)

②利用存储过程产生添加客户数据,其存储过程如下:

 CREATE proc AddCustomer

 @Name varchar(20),

 @Addr varchar(100),

 @Area_Code char(10),

 @Contact1 varchar(20),

 @Tel char(10)

As

 declare @Code char(10)

 declare @Mid int

 exec getIdent 'TCustomer',

 @Mid Output

 << 上一页  [11] [12] [13] [14] [15] [16] [17] [18] [19] [20]  ... 下一页  >> 

Copyright © 2007-2012 www.chuibin.com 六维论文网 版权所有