I work in C++ Builder 2010 with MS Access DB. I use ONE UniTable for output 10 tables. If I write queries like "select * from table" or "select f1, f2, f3 from table" it works, but if I write queries like: "select f1 AS [name]... from table" then it does not work. If I add construction "AS [....]" in a queries, I can see contents in the grid, but if I want to delete or insert any records, I get the error: "Cannot modify a read-only dataset".
I use methods UniTable->Delete(); and UniTable->Insert();
When I open grid I do it as:
Code: Select all
DataModule4->UniTable1->Active=false;
DataModule4->UniTable1->TableName="Tipy_Bortov";
DataModule4->UniTable1->SQL->Text="SELECT Tip_Borta AS [Тип ВС] FROM Tipy_Bortov";
DataModule4->UniTable1->Active=true;I need my own names in grid's headers.
Can I add fields in UniTable by program code like on a form ?




Help me please. A lot of thanks!