Changeset 28 for trunk/UDatabase.pas
- Timestamp:
- Sep 10, 2022, 10:21:48 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UDatabase.pas
r26 r28 4 4 5 5 uses 6 Classes, SysUtils, ExtCtrls, StdCtrls, EditBtn, dialogs, USqlDatabase,7 URegistry, UGenerics,Generics.Collections;6 Classes, SysUtils, ExtCtrls, dialogs, USqlDatabase, URegistry, UGenerics, 7 Generics.Collections; 8 8 9 9 type … … 561 561 Count := Source.Count; 562 562 for I := OldCount to Count - 1 do 563 //ShowMessage(TValue(Source.Items[I]).ClassName);564 563 Items[I] := TValueClass(Source.Items[I].ClassType).Create; 565 564 for I := 0 to Count - 1 do … … 631 630 begin 632 631 I := 0; 633 while (I < Count) and ( TField(Items[I]).Name <> Name) do Inc(I);634 if I < Count then Result := TField(Items[I])632 while (I < Count) and (Items[I].Name <> Name) do Inc(I); 633 if I < Count then Result := Items[I] 635 634 else Result := nil; 636 635 end; … … 672 671 FieldIndex := Parent.Fields.IndexOf(Field); 673 672 if Assigned(Field) then begin 674 if TValue(Values[FieldIndex]).GetString <> AValues.ValueFromIndex[I] then begin673 if Values[FieldIndex].GetString <> AValues.ValueFromIndex[I] then begin 675 674 Result := False; 676 675 Break; … … 686 685 Values.Clear; 687 686 for I := 0 to Parent.Fields.Count - 1 do 688 Values.Add( TField(Parent.Fields[I]).GetValueClass.Create);687 Values.Add(Parent.Fields[I].GetValueClass.Create); 689 688 end; 690 689 … … 823 822 DbRows := TDbRows.Create; 824 823 try 825 DbClient.Query('SELECT COUNT(*) AS `Count`FROM ' + Name, DbRows);824 DbClient.Query('SELECT COUNT(*) FROM ' + Name, DbRows); 826 825 if DbRows.Count = 1 then begin 827 RecordsCount := StrToInt(DbRows[0].Items['C ount']);826 RecordsCount := StrToInt(DbRows[0].Items['COUNT(*)']); 828 827 end else RecordsCount := 0; 829 828 finally … … 852 851 FreeAndNil(Fields); 853 852 FreeAndNil(Records); 854 inherited Destroy;853 inherited; 855 854 end; 856 855
Note:
See TracChangeset
for help on using the changeset viewer.