Ignore:
Timestamp:
Dec 25, 2010, 9:53:55 PM (14 years ago)
Author:
george
Message:
  • Updated: USqlDatabase library.
  • Added: Dependency to TemplateGenerics package.
  • Modified: Rest of czech strings translated to english.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UMainForm.pas

    r6 r7  
    100100  MainForm: TMainForm;
    101101
     102resourcestring
     103  SItemNotFound = 'Item not found';
     104  SObjectNotFound = 'Object not found';
     105
     106
    102107implementation
    103108
     
    129134            Database.HostName := TextContent;
    130135          if NodeName = 'schema' then
    131             Database.Schema := TextContent;
     136            Database.Database := TextContent;
    132137          if NodeName = 'username' then
    133138            Database.UserName := TextContent;
     
    306311    TopItem.SelectedIndex := 0;
    307312    try
    308       DbRows := Database.Query('SELECT * FROM `ObjectGroup`');
     313      DbRows := TDbRows.Create;
     314      Database.Query(DbRows, 'SELECT * FROM `ObjectGroup`');
    309315      for I := 0 to DbRows.Count - 1 do begin
    310316        NewNode := AddChild(TopItem, DbRows[I].Values['Name']);
     
    313319        NewNode.Data := Pointer(StrToInt(DbRows[I].Values['Id']));
    314320        try
    315           ObjectDbRows := Database.Query('SELECT * FROM `Object` WHERE `Group`=' + DbRows[I].Values['Id']);
     321          ObjectDbRows := TDbRows.Create;
     322          Database.Query(ObjectDbRows, 'SELECT * FROM `Object` WHERE `Group`=' + DbRows[I].Values['Id']);
    316323          for O := 0 to ObjectDbRows.Count - 1 do begin
    317324            NewObjectNode := AddChild(NewNode, ObjectDbRows[O].Values['Name']);
     
    348355    Clear;
    349356    try
    350     DbRows := Database.Query('SELECT * FROM `Object` WHERE `Id`=' + IntToStr(Integer(TreeView1.Selected.Data)));
     357    DbRows := TDbRows.Create;
     358    Database.Query(DbRows, 'SELECT * FROM `Object` WHERE `Id`=' + IntToStr(Integer(TreeView1.Selected.Data)));
    351359    if DbRows.Count = 1 then begin
    352360      SelectedObject := StrToInt(DbRows[0].Values['Id']);
     
    354362      // Load column names
    355363      try
    356         Properties := Database.Query('SELECT * FROM `Property` WHERE `Object`=' +
     364        Properties := TDbRows.Create;
     365        Database.Query(Properties, 'SELECT * FROM `Property` WHERE `Object`=' +
    357366          DbRows[0].Values['Id']);
    358367        Columns.Clear;
     
    371380      // Load items
    372381      try
    373       Values := Database.Query('SELECT * FROM `' + DbRows[0].Values['Schema'] + '`.`' +
     382      Values := TDbRows.Create;
     383      Database.Query(Values, 'SELECT * FROM `' + DbRows[0].Values['Schema'] + '`.`' +
    374384        DbRows[0].Values['Table'] + '`');
    375385      for I := 0 to Values.Count - 1 do begin
Note: See TracChangeset for help on using the changeset viewer.