Cannot modify a read-only dataset.
Cannot modify a read-only dataset.
I write in C++ Builder 2010, and I have some problem with UniTable.
I Use Access DB. I can connect to Db and I can insert something into db. But if I want to delete anything from db by method "Delete()", Builder writes the error "Cannot modify a read-only dataset." all "read-only" properties is FALSE any where.
Who does know, help me please =)
I Use Access DB. I can connect to Db and I can insert something into db. But if I want to delete anything from db by method "Delete()", Builder writes the error "Cannot modify a read-only dataset." all "read-only" properties is FALSE any where.
Who does know, help me please =)
I have found the place where the error appears. When I write flolow code:
after string, UniTable1->SQL->Text="Select ID_AC, NameOfAC as [Типы ВС] From TypesOfBoards";, where I edit SQL text, this error are appearing. If do not edit this string, then it's works.[/i]
I made this query because I need my own names of fields in DBGreed
Code: Select all
UniTable1->Active=false;
UniTable1->TableName="TypesOfBoards";
[u]UniTable1->SQL->Text="Select ID_AC, NameOfAC as [Типы ВС] From TypesOfBoards";[/u]
UniTable1->Active=true;
UniDataSource1->DataSet=DataModule4->UniTable1;
I made this query because I need my own names of fields in DBGreed
===============================================Fastex wrote:I have found the place where the error appears. When I write flolow code:
after string, UniTable1->SQL->Text="Select ID_AC, NameOfAC as [Типы ВС] From TypesOfBoards";, where I edit SQL text, this error are appearing. If do not edit this string, then it's works.[/i]Code: Select all
UniTable1->Active=false; UniTable1->TableName="TypesOfBoards"; [u]UniTable1->SQL->Text="Select ID_AC, NameOfAC as [Типы ВС] From TypesOfBoards";[/u] UniTable1->Active=true; UniDataSource1->DataSet=DataModule4->UniTable1;
I made this query because I need my own names of fields in DBGreed
I have sloved the problem by DBGrid->Columns->Items[]->Title->Caption="";
But I wont to know how does it work
Hello,
If you have added any fields into TUniTable and after that you have changed the set of fields, you will get the error. So if you need to change the set of fields, you should clear the set of fields in TUniTable like UniTable1->Fields->Clear(), or if you need to change only the names of columns in DBGrid, you should change the Title.Caption properties without changing the SQL statement like DBGrid1->Columns[0]->Title->Caption := "new caption".
So as I have written you earlier, to use your own SQL statement you should use TUniQuery instead of TUniTable.
If you have added any fields into TUniTable and after that you have changed the set of fields, you will get the error. So if you need to change the set of fields, you should clear the set of fields in TUniTable like UniTable1->Fields->Clear(), or if you need to change only the names of columns in DBGrid, you should change the Title.Caption properties without changing the SQL statement like DBGrid1->Columns[0]->Title->Caption := "new caption".
So as I have written you earlier, to use your own SQL statement you should use TUniQuery instead of TUniTable.