4 月15日总结下

时间:2021-12-30 14:08:08

昨天本来想加班把东西做完的,可是居然睡着了,算是本周第二个子夜觉吧。明天后天都可以熬夜了。

今天测试程度的时候发现昨天的那个查找handle自动隐藏的方法是有bug的,Treelist弹出菜单后就会

自动隐藏。是不是应该在确定是treeview后把坐标转换下,这样只要是在treeview范围内做操作都不

会有问题了。

下面是昨天看到的adodataset的Requery函数

procedure TCustomADODataSet.InternalRequery(Options: TExecuteOptions = []);
begin
if FConnectionChanged then
DatabaseError(SCantRequery);
try
Recordset.Requery(ExecuteOptionsToOrd(Options));//这里调的是dll
except
if Recordset.State = adStateClosed then Close;
raise;
end;
DestroyLookupCursor;
end;

 

procedure TCustomADODataSet.DestroyLookupCursor;
begin
FLookupCursor := nil;
FFindCursor := nil;
end;

 

procedure TCustomADODataSet.Requery(Options: TExecuteOptions = []);
begin
CheckBrowseMode;
InternalRequery(Options);
First;
end;

功能什么的就不说了

 EDatabaseError = class(Exception);

procedure DatabaseError(const Message: string; Component: TComponent = nil);
begin
if Assigned(Component) and (Component.Name <> '') then
raise EDatabaseError.Create(Format('%s: %s', [Component.Name, Message])) else
raise EDatabaseError.Create(Message);
end;

以后自己的程序里也要回个这样的算是函数,在不用动不动就exit还要注意是不是在Try Except里面

方便点.