Changeset 7 for trunk/Forms/UMainForm.pas
- Timestamp:
- Dec 25, 2010, 9:53:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UMainForm.pas
r6 r7 100 100 MainForm: TMainForm; 101 101 102 resourcestring 103 SItemNotFound = 'Item not found'; 104 SObjectNotFound = 'Object not found'; 105 106 102 107 implementation 103 108 … … 129 134 Database.HostName := TextContent; 130 135 if NodeName = 'schema' then 131 Database. Schema:= TextContent;136 Database.Database := TextContent; 132 137 if NodeName = 'username' then 133 138 Database.UserName := TextContent; … … 306 311 TopItem.SelectedIndex := 0; 307 312 try 308 DbRows := Database.Query('SELECT * FROM `ObjectGroup`'); 313 DbRows := TDbRows.Create; 314 Database.Query(DbRows, 'SELECT * FROM `ObjectGroup`'); 309 315 for I := 0 to DbRows.Count - 1 do begin 310 316 NewNode := AddChild(TopItem, DbRows[I].Values['Name']); … … 313 319 NewNode.Data := Pointer(StrToInt(DbRows[I].Values['Id'])); 314 320 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']); 316 323 for O := 0 to ObjectDbRows.Count - 1 do begin 317 324 NewObjectNode := AddChild(NewNode, ObjectDbRows[O].Values['Name']); … … 348 355 Clear; 349 356 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))); 351 359 if DbRows.Count = 1 then begin 352 360 SelectedObject := StrToInt(DbRows[0].Values['Id']); … … 354 362 // Load column names 355 363 try 356 Properties := Database.Query('SELECT * FROM `Property` WHERE `Object`=' + 364 Properties := TDbRows.Create; 365 Database.Query(Properties, 'SELECT * FROM `Property` WHERE `Object`=' + 357 366 DbRows[0].Values['Id']); 358 367 Columns.Clear; … … 371 380 // Load items 372 381 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'] + '`.`' + 374 384 DbRows[0].Values['Table'] + '`'); 375 385 for I := 0 to Values.Count - 1 do begin
Note:
See TracChangeset
for help on using the changeset viewer.