function OpenSQL(s: string;query:TADODataSet):integer; var old_Cursor:TCursor; begin old_Cursor:=screen.cursor; screen.cursor:=crSQLWait; try try with query do begin close; commandtext:=s; open; result:=query.recordcount; end; except result:=0; end; finally screen.cursor:=old_Cursor; end; end;
function DoSQL(s: string;query:TADOQuery):boolean; var old_Cursor:TCursor; begin result:=true; old_Cursor:=screen.cursor; screen.cursor:=crSQLWait; try try with query do begin close; SQL.Clear ; SQL.Add(s); ExecSQL; end; except result:=false; end; finally screen.cursor:=old_Cursor; end; end;