Search the Community
Showing results for tags 'database'.
-
- 5 replies
-
- responsiveness
- responsivo
-
(and 11 more)
Tagged with:
-
I load in treeview my data from database and i want add childs on expand node. To do this in fist time add node and if has a children add empty child node to get a plus, but when expand node for a short time there is an empty node, and then the real children. How can this be avoided? procedure TMainForm.LoadChilds(const ANodeID: integer; const ANode: TUniTreeNode); var Node: TUniTreeNode; NodeData: PVSTRecord; FirstStep: boolean; begin if Assigned(ANode) then if PVSTRecord(ANode.Data).Expanded then exit; trView.BeginUpdate; try with UniMainModule.ODS do begin Close; DeleteVariables; DeclareVariable('acur', otCursor); DeclareAndSet('aid_parent', otInteger, ANodeID); DeclareAndSet('aid_user', otInteger, ID_USER); Open; FirstStep:= True; while not eof do begin if FirstStep then begin if Assigned(ANode) then begin if ANode.HasChildren then begin Node:= ANode.GetFirstChild; Node.Text:= FieldByName('name_').AsString; end else Node:= trView.Items.Add(ANode, FieldByName('name_').AsString); end else Node:= trView.Items.Add(ANode, FieldByName('name_').AsString); FirstStep:= False; end else begin Node:= trView.Items.Add(ANode, FieldByName('name_').AsString); end; if FieldByName('child_cnt').AsInteger > 0 then //Node.HasChildren:= (FieldByName('child_cnt').AsInteger > 0); trView.Items.Add(Node, ''); new(NodeData); NodeData.NodeID := FieldByName('id_node').AsInteger; NodeData.NodeParentID:= FieldByName('id_par').AsInteger; NodeData.NodeName := FieldByName('name_').AsString; NodeData.Count := FieldByName('child_cnt').AsInteger; NodeData.Expanded:= False; NodeData.Read:= 1; NodeData.NodeType:= FieldByName('id_type').AsInteger; NodeData.ShablonID:= FieldByName('id_shablon').AsInteger; Node.Data:= NodeData; Next; end; CloseAll; end; if Assigned(ANode) then PVSTRecord(ANode.Data).Expanded:= True; finally trView.EndUpdate; end; end;
-
When user is waiting fairly time consuming SQL query to finish and application crashes (halts without a trace but that's a another problem) for some reason, database connection might leave table(s) locked. This will cause said table to be unreadable (without dirty read) until database server is restarted. I thought that any and all database connections will be disconnected and any possible locks will be released when application crashes but that doesn't seem to be case. Do any of you have any suggestions how to track down and solve this problem? Database backend is Microsoft SQL Server 2014 Express and I use FireDAC access it. uniGUI version is 1.0.0.1406 (Complete). // Mika
- 3 replies
-
- database
- sql server
-
(and 2 more)
Tagged with: