كيفية تحويل تسجيل من جدول الى جدول اخر
#2
السلام عليكم
استخدام AppendRecord لإضافة سجل بأكمله
مثال لاستخدامها لنسخ نفس الحقل في الجدول:
PHP كود :
procedure DuplicateCurrentRecord(aDataSet : TDataSet);
var
  
Data : array of variant;
  
aRecord : array of TVarRec;
  
i : integer;
  
max : integer;
begin
  max 
:= aDataSet.fields.count -1;
  
// set the lenghth of the arecord array to be the same as the number of
  // elements in the data array
  
SetLength(arecord,max+1);
  
SetLength(data,max+1);

  
// set the variant type pointers to the data array
  
for i := 0 to max do
  
begin
    arecord
[i].VType := vtVariant;
    
arecord[i].VVariant := @data[i];
  
end;

  
// Copy the Record to the Array
  
for i := 0 to max do
    
Data[i] := aDataSet.fields[i].value;

  
// finally append the record in one go
  
aDataSet.AppendRecord(aRecord);
end; 
عدل على المثال كما تشاء Smile
بالتوفيق.
اللهم احقن دماء المسلمين، لا تنسوهم بالدعاء...
الرد


الردود في هذا الموضوع
كيفية تحويل تسجيل من جدول الى جدول اخر - بواسطة kachwahed - 09-04-2010, 07:07 PM

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم