Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

delphi DataSnap³²×´Ö÷´Ó±íʵÏÖ

·þÎñ¶Ë£ºÌí¼ÓADOConnection£¬ADOQuery1£¬ADOQuery2¡£ÉèÖÃADOQuery1ΪÖ÷±í£¬ADOQuery2Ϊ´Ó±í¡£(ͨ¹ý  ADOQuery2.SQL.Text:= 'select * from ´Ó±í where FKID=:Ö÷±íPKID'ÉèÖÃ)¡£Ìí¼ÓDataSetProvider1ºÍDataSetProvider2·Ö±ðÁ¬½Óµ½ADOQuery1ºÍADOQuery2¡£
¿Í»§¶Ë£ºÌí¼ÓClientDataSet1£¬ClientDataSet2¡£ClientDataSet1Á¬½Óµ½DataSetProvider1¡£Ë«»÷ClientDataSet1£¬ÓÒ¼üAdd All Field¡£¿ÉÒÔ¿´µ½Ò»¸öTDataSetField×ֶΡ£ÉèÖÃClientDataSet2µÄDataSetFieldÊôÐÔΪClientDataSet1ÖеÄTDataSetFieldÁС£Ìí¼ÓDataCourse1¡¢DataSource2·Ö±ðÁ¬½Óµ½ClientDataSet1ºÍClientDataSet2¿Ø¼þ¡£Ìí¼ÓDBGrid1ºÍDBGrid2·Ö±ðÁ¬½Óµ½DataCourse1¡¢DataSource2¡£ÉèÖÃClientDataSet1.Active:= True;Õâʱ·¢ÏÖClientDataSet2Ò²×Ô¶¯´ò¿ª¡£
×ÔÔöÁд¦Àí:¼ÙÈçÖ÷´Ó±íµÄÖ÷Íâ¼ü¶¼ÊÇ×ÔÔöÁУ¬Õâʱ¿ÉÒÔÔÚ·þÎñ¶Ë´¦ÀíÖ÷´Ó±í¹ØÁª¡£ÔÚDataSetProvider1ÖеÄBeforeUpdateRecordʼþÖÐÌí¼ÓÈçÏ´úÂ룺
procedure TForm1.DataSetProvider1BeforeUpdateRecord(Sender: TObject;
  SourceDS: TDataSet; DeltaDS: TCustomClientDataSet;
  UpdateKind: TUpdateKind; var Applied: Boolean);
begin
  if ((UpdateKind = ukInsert) and
  (SourceDS = ADOQuery2)
   {and (DeltaDS.FieldByName('PKID').Value =  Unassigned)}) then
  begin
    if DeltaDS.BOF then
    begin
      qryIdentity.Close;  //qryIdentity.Sql.Text:= 'select @@identity';»ñÈ¡Ö÷±í×ÔÔöÁеÄ×îÐÂÖµ
      qryIdentity.Open;
    end;
    DeltaDS.FieldByName('PKID').NewValue := qryIdentity.Fields[0].Value;//¸³¸ø×Ó±íµÄµ±Ç°ÐÐ
  end;
end;
this over.


Ïà¹ØÎĵµ£º

DELPHIÃæÏò¶ÔÏó²Î¿¼

¡¡¡¡DELPHIÃæÏò¶ÔÏó²Î¿¼
¡¡¡¡³ÂÆæ 2005-07-21
¡¡¡¡Ò»¡¢ÀàºÍ¶ÔÏó
¡¡¡¡ÀàÊǶÔÏóµÄÀàÐÍ£¬ÊÇ´´½¨¶ÔÏóµÄÄ£°å¡£Ò»¸öÀà¿ÉÒÔ´´½¨¶à¸ö¶ÔÏ󣬶øÒ»¸ö¶ÔÏó×ÜÊÇÊôÓÚij¸öÀà¡£Àà¾ßÓÐÄÚ²¿µÄÊôÐÔ£¨×´Ì¬£©ºÍÐÐΪ£¨²Ù×÷£©¡£
¡¡¡¡¶ÔÏóÊÇÀàµÄʵÀý£¬¾ßÓÐÇø±ðÓÚͬÀàÆäËû¶ÔÏóµÄÊôÐÔ¼¯ºÏ¡£
¡¡¡¡¶ÔÏóµÄÉùÃ÷´æ·ÅÓÚ¶ÑÕ»£¬¶ÔÏóµÄÒýÓôæ·ÅÓڶѡ£
¡¡¡ ......

DelphiдµÄÑéÖ¤Éí·ÝÖ¤ºÅÓÐЧÐÔº¯Êý


function ValidatePID(const APID: string): string;
{ÄÚ²¿º¯Êý,È¡Éí·ÝÖ¤ºÅУÑéλ,×îºóһλ,¶Ô18λÓÐЧ}
function GetVerifyBit(sIdentityNum: string): Char;
var
    nNum: Integer;
begin
    Result := #0;
    nNum := StrToInt(sIdentityNum[1]) * 7 +
  ......

ÈçºÎÈÃDelphiµ÷ÓÃÍⲿ³ÌÐò²¢µÈ´ýÆäÔËÐÐÐÅÏ¢£¨Èç½áÊø£©

º¯ÊýÒ»£º
view plaincopy to clipboardprint?
uses 
    Windows,  
    SysUtils,  
    Classes,  
    ShellAPI;  
function RunAndWait(FileName: string; Visibility: Integer): THandle;&nbs ......

Delphi º¯Êý´óÈ«

Ãû³Æ ÀàÐÍ ËµÃ÷  
abort º¯Êý ÒýÆð·ÅÆúµÄÒâÍâ´¦Àí  
abs º¯Êý ¾ø¶ÔÖµº¯Êý  
addexitproc º¯Êý ½«Ò»¹ý³ÌÌí¼Óµ½ÔËÐÐʱ¿âµÄ½áÊø¹ý³Ì±íÖР 
addr º¯Êý ·µ»ØÖ¸¶¨¶ÔÏóµÄµØÖ·  
adjustlinebreaks º¯Êý ½«¸ø¶¨×Ö·û´®µÄÐзָô·ûµ÷ÕûΪcr/lfÐòÁР 
align Êô ......

DELPHIÃæÏò¶ÔÏó²Î¿¼


Ò»¡¢ÀàºÍ¶ÔÏó
ÀàÊǶÔÏóµÄÀàÐÍ£¬ÊÇ´´½¨¶ÔÏóµÄÄ£°å¡£Ò»¸öÀà¿ÉÒÔ´´½¨¶à¸ö¶ÔÏ󣬶øÒ»¸ö¶ÔÏó×ÜÊÇÊôÓÚij¸öÀà¡£Àà¾ßÓÐÄÚ²¿µÄÊôÐÔ£¨×´Ì¬£©ºÍÐÐΪ£¨²Ù×÷£©¡£
¶ÔÏóÊÇÀàµÄʵÀý£¬¾ßÓÐÇø±ðÓÚͬÀàÆäËû¶ÔÏóµÄÊôÐÔ¼¯ºÏ¡£
¶ÔÏóµÄÉùÃ÷´æ·ÅÓÚ¶ÑÕ»£¬¶ÔÏóµÄÒýÓôæ·ÅÓڶѡ£
¶þ¡¢ÀàµÄ·½·¨·ÖÀà
1¡¢  ÆÕͨ·½·¨
²»¼ÓÈκÎÐÞÊε ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ