ADO Database Delphi

Title: Adjusting width of Orpheus Table column to extra client space
Question: The attached routine will automatically resize a specific column (you choose) to use up the excess space in a tOvcTable, essentially creating an autosizing column, and eliminating the horz. scroll bar.
Answer:
If you have a tOvcTable that you would like to have one column resize automatically to use up any excess space, the following routine in your FormResize method will do the trick.
const
cnName = 3; {Column number to get the extra space}
procedure TForm1.FormResize(Sender: TObject);
var
I,W,SW:integer;
begin
{ Make the cnName (name) column use up the remaining space }
{ with other columns staying the same width }
SW:=GetSystemMetrics(SM_CXVScroll); {width of scrollbar, if showing}
{ Figure space for table border }
if eTable.BorderStyle=bsSingle then
W:=5
else
W:=1;
{ Add in widths of all columns except the one that gets the extra space }
for I:=0 to eTable.ColCount-1 do
if IcnName then
W:=W+eTable.Columns[I].Width;
{ Calculate the new width of the column }
W:=ClientWidth-(W+SW);
{ Set the width now }
eTable.Columns[cnName].Width:=W;
end;
The clientwidth of the window is calculated to prevent the scrollbar (horz.) from needing to appear, which makes for cleaner viewing.
You could expand the routine to split the excess between several columns, or even all of them!