Hi guys. I have DBGRID with some columns in it. I want to sort resoults 'ASC' or 'DESC' when i click on particular column title..
Im using this code to sort
Problem is that this code only sorts on ASC order , i tried to do something like
but code is not working, so can u guys help me how to sort it on click.. Basically what i need is if column is sorted asc on click sort it desc and if it is desc on click sort it asc
Next questions was about turning off program remotely. My clients should pay me every month for maintenance + hostings + all that stuff.. I want to shut down their desktop app remotely if they dont pay me on the end of the month..
I was thinking to make some sort of timer that sends web request to server every 5sec for example , and if server respond true program will continue running , if web server respond false program will close itself and make changes in registry.
When they start program again program will close cuz it will check registry.. I know that they can operate offline using this method but that is what i was my idea, maybe you guys have some better ideas ? Thanks ✌
Im using this code to sort
PHP Code
<?php
procedure TForm1.DBGrid1TitleClick(Column: TColumn);
begin
with TCustomADODataSet(DBGrid1.DataSource.DataSet) do
begin
Sort := Column.Field.FieldName;
end;
end;
Problem is that this code only sorts on ASC order , i tried to do something like
PHP Code
<?php
var
asc: boolean
begin
asc:= true;
if asc then
Sort := Column.Field.FieldName + 'asc';
asc:= false;
exit;
if not asc then
Sort := Column.Field.FieldName + 'desc';
asc:= true;
exit;
but code is not working, so can u guys help me how to sort it on click.. Basically what i need is if column is sorted asc on click sort it desc and if it is desc on click sort it asc
Next questions was about turning off program remotely. My clients should pay me every month for maintenance + hostings + all that stuff.. I want to shut down their desktop app remotely if they dont pay me on the end of the month..
I was thinking to make some sort of timer that sends web request to server every 5sec for example , and if server respond true program will continue running , if web server respond false program will close itself and make changes in registry.
When they start program again program will close cuz it will check registry.. I know that they can operate offline using this method but that is what i was my idea, maybe you guys have some better ideas ? Thanks ✌
Proud to be 100.000 user on HF
![[Image: 4tAQ4Gf.png]](https://i.imgur.com/4tAQ4Gf.png)

