DelphiÖ÷´Ó±íÀý×Ó
ÔÚsql server µÄnorthwide Öн¨Á¢Ö÷±í
create table sell_h( sell_id char(10),cust_name char(10) Primary key(sell_id) )
go
create table sell_h( sell_id char(10),inv char(10) ,amt float,qty float Primary key(sell_id,inv) )
Ê×ÏÈ,ҪעÒâÒÔÏÂÉèÖÃ
1.ҪעÒⱨ´Ó±íqrydetailÉèÖÃ,Åú±£´æ¿ªÊ½. ¼´.locktype= batchoptimistic ,cursortype=keyset,cursorlocation
=cluseclient
2.
procedure TForm1.FormCreate(Sender: TObject);
begin
qrymain.Close;
qrydetail.Close;
qrymain.SQL.Add(' select * from sell_h') ;
qrydetail.SQL.add('select * from sell_b where sell_id = :sell_id') ;
qrymain.Open;
qrydetail.Open;
end;
3.
procedure TForm1.qrymainAfterScroll(DataSet: TDataSet);
begin
qrydetail.Close;
qrydetail.Parameters.ParamByName('sell_ID').Value := qrymain.fieldbyname('sell_id').value;
qrydetail.Open;
end;
ÒÔÉϾÍÊÇÖ÷ÒªµÄÉèÖÃ,»¹ÓÐ×¢ÒâÖ÷´Ó±íµÄ±£´æÎÊÌâ:
Ö÷±í²»ÒªÓÃÅú´¦Àí£¬Ö±½Ó±£´æ,°ÑltBatchOptimisticÈ¥µô
Ã÷ϸ±íÓÃÅú´¦Àí¡£
±£´æʱÏȱ£´æÃ÷ϸ±í£¬ÔÙ±£´æÖ÷±í¼´¿É¡£
ADOÖÐADOTable¡¢ADOQueryºÍADODataSetÖ÷´Ó±íÉèÖÃ
1¡¢ADOTableµÄÖ÷´Ó±íÉèÖÃ
Ö÷±íÃûΪjxc_out£¬´Ó±íÃûΪjxc_out_detl Ö÷±íÓë´Ó±í¹ØÁª×Ö¶ÎΪdraw_no
tbM: TADOTable;
tbD: TADOTable;
dtsM: TDataSource;
dtsD: TDataSource;
tbM.TableName=jxc_out
tbD.TableName=jxc_out_detl
dtsM.DataSet=tbM
dtsD.DataSet=tbD
tbD.MasterSource=tbM
ÔÚ´Ó±íµÄ[tbD]ÖÐÑ¡ÔñMasterFieldsÊôÐÔ£¬Ñ¡ÔñÖ÷±íºÍ´Ó±í¹ØÁªµÄ×ֶΣ¬È»ºóÖ´ÐÐtbM.openºÍtbD.Open¼´¿É
2¡¢ADOQueryµÄÖ÷´Ó±íÉèÖÃ
Ö÷±íÃûΪjxc_out£¬´Ó±íÃûΪjxc_out_detl Ö÷±íÓë´Ó±í¹ØÁª×Ö¶ÎΪdraw_no
adqM: TADOQuery;
adqD: TADOQuery;
dtsM: TDataSource;
dtsD: TDataSource;
tbM.sql.text=select * from jxc_out
tbM.sql.text=select * from jxc_out_detl where draw_no=:draw_no
dtsM.DataSet=adqM
dtsD.DataSet=adqD
dtsD.DataSource=dtsM
Ö´ÐÐadqM.openºÍadqD.Open¼´¿É
3¡¢ADODataSetÖ÷´Ó±íÉèÖÃ
¸úADOQueryÉèÖò¶à£¬²»¹ýADODataSetÉèÖõÄÊÇcommandtext
Ïà¹ØÎĵµ£º
1.Round£¨ËÄÉáÁùÈëÎåÁôË«£©
¹¦ÄÜ˵Ã÷£º¶ÔÒ»¸öʵÊý½øÐÐËÄÉáÎåÈë¡£(°´ÕÕÒøÐмÒËã·¨)
Àý£º
var
i, j: Integer;
begin
i := Round(1.5); // iµÈÓÚ2
j := Round(2.5); // jµÈÓÚ2
end;
ÔÚDelphiÖÐʹÓÃRoundº¯ÊýµÃµ½µÄ´ð°¸ÓÐʱÓëÎÒÃÇËùÔ¤ÆڵĻ᲻̫һÑù£º²ÉÓõÄÊÇËÄÉáÁùÈëÎåÁôË«¡£¼´µ±Éá»òÈëλ´óÓÚ»òСÓÚÎåÊ ......
[code=Delphi(Pascal)]
unit uThreadPool;
{ aPool.AddRequest(TMyRequest.Create(RequestParam1, RequestParam2, ...)); }
interface
uses
Windows,
Classes;
// ÊÇ·ñ¼Ç¼ÈÕÖ¾
// {$DEFINE NOLOGS}
type
TCriticalSection = class(TObject)
protected
FSec ......
delphiµ÷ÓÃÑ¡ÔñĿ¼¶Ô»°¿ò
¾³£¼ûÍøÉÏÓÐÈËÎÊÑ¡ÔñĿ¼¶Ô»°¿òµÄ¿Ø¼þ£¬ÆäʵֻÓÃÒ»¸öº¯Êý¾Í¿ÉÒÔʵÏÖ¡£
×¢ÒâÒýÓÃ Filectrl µ¥Ôª
use Filectrl;
procedure TForm1.Button1Click(Sender: TObject);
var
Dir: String;
begin
SelectDirectory('Select a directory', '', Dir);
ShowMessage(Dir);
end; ......
DelphiµÄ·½·¨ÀàÐÍÓУº
1.¾²Ì¬·½·¨ (Static) ĬÈÏÀàÐÍ£¬¿ÉÒÔÊ¡ÂԹؼü×Ö
2.ÐéÄâ·½·¨ (Virtual)
3.¶¯Ì¬·½·¨ (Dynamic)
4.ÏûÏ¢·½·¨ (Message)
5.³éÏó·¨·½ (Abstract)
=======================================================
1£©¾²Ì¬·½·¨[static]
¾²Ì¬·½·¨ÀàËÆÓÚͨ³£µÄ¹ý³ÌºÍº¯Êý£¬±àÒëÆ÷ÔÚ±àÒëʱ¾ÍÒÑÖ¸¶¨ÁËÊä³ö¸Ã·½· ......
Delphi ÖÐÈçºÎ°²×°×é¼þ?
delphiÖÐÈçºÎ°²×°×é¼þÓÐÎåÖÖÇé¿ö£º
1¡¢Ö»ÓÐÒ»¸öDCUÎļþµÄ×é¼þ¡£DCUÎļþÊDZàÒëºÃµÄµ¥ÔªÎļþ£¬ÕâÑùµÄ×é¼þÊÇ×÷Õß²»Ïë°ÑÔ´Â빫²¼¡£Ò»°ãÀ´Ëµ£¬×÷Õß±ØÐë˵Ã÷´Ë×é¼þÊʺÏDelphiµÄÄÄÖÖ°æ±¾£¬Èç¹û°æ±¾²»¶Ô£¬ÔÚ°²×°Ê±¾Í»á³öÏÖ´íÎó¡£Ò²ÕýÊÇÒòΪûÓÐÔ´Â룬¸øʹÓÃÕß´øÀ´Á˲»±ã£¬ÄǾÍÊÇÒ»µ©Delphi°æ±¾Éý¼¶£¬´Ë× ......