@All
Proxy??? Help :O
@JonB said in Possibilities for adding new **records** inside database:
Still not sure what you mean. If you are creating a VIEW by JOINing tables together, you cannot edit rows via the VIEW (unless it's an editable VIEW, but that's another matter, unless you say that's what you have created), even in SSMS, only view them! You can only edit rows in an actual single table.
That is correct. I can not edit the rows but like I said it is very uncomfortable to add like 20 LineEdits inside the gui to be able to edit all of my attributes from one table.
So for me is the best solution to desclaim the usage of 20 LineEdits and transfer such input possibility directly inside the QTableView.
1.Step
Created a view inside the SSMS with joined table etc whatever completly free. The view is not editable.
2.Step Qt
2.1When I press "Insert" than a table pops up with 1...n Attributes, whereas it corresponds to the created view inside SSMS.
TblModel->setTable(SSMSView);
TblModel->setEditStrategy(QSqlTableModel::OnManualSubmit);
TblModel->select();
QSqlRecord record = TblModel->record();
record.setValue(TblModel->fieldIndex("Attribute1"),"*");
record.setValue(TblModel->fieldIndex("Attribute2"),"*");
record.setValue(TblModel->fieldIndex("Attribute3"),"*");
record.setValue(TblModel->fieldIndex("Attribute4"),"*");
TblModel->insertRecord(TblModel->rowCount(),record);
Here a line is created inside the TableView where the mandatory fields are marked with *
Now the user makes his input by inserting data field by field inside the given row.
2.2When I press "Submit" than
...I extract data for table 1 and perform submitAll for the selected table 1.
...I ...table2 ....table2
and so on.
Challange solved.