Ik heb een n-tier applicatie welke gebruikt maakt van een MSSQL server.
Aan de server kant gebruik ik ADODataSet's en DataSetProvider's. Op de client gebruik ik ClientDataSet's.
Als ik nu een update/insert uitvoer op een ClientDataSet die een query (met INNER JOIN ofzo) heeft open heeft staan die over meedere tabellen rijkt, dan wil dit niet.
Stukje uit de help hierover:
When a dataset provider generates SQL statements that apply updates directly to a database server, it needs the name of the database table that contains the records. This can be handled automatically for many datasets such as table-type datasets or live TQuery components. Automatic updates are a problem however, if the provider must apply updates to the data underlying a stored procedure with a result set or a multi-table query. There is no easy way to obtain the name of the table to which updates should be applied.
If the query or stored procedure is a BDE-enabled dataset (TQuery or TStoredProc) and it has an associated update object, the provider uses the update object. However, if there is no update object, you can supply the table name programmatically in an OnGetTableName event handler. Once an event handler supplies the table name, the provider can generate appropriate SQL statements to apply updates.
Supplying a table name only works if the target of the updates is a single database table (that is, only the records in one table need to be updated). If the update requires making changes to multiple underlying database tables, you must explicitly apply the updates in code using the BeforeUpdateRecord event of the provider. Once this event handler has applied an update, you can set the event handlers Applied parameter to True so that the provider does not generate an error.
Note:If the provider is associated with a BDE-enabled dataset, you can use an update object in the BeforeUpdateRecord event handler to apply updates using customized SQL statements.
Is er een simpele oplossing voor dit probleem?
Aan de server kant gebruik ik ADODataSet's en DataSetProvider's. Op de client gebruik ik ClientDataSet's.
Als ik nu een update/insert uitvoer op een ClientDataSet die een query (met INNER JOIN ofzo) heeft open heeft staan die over meedere tabellen rijkt, dan wil dit niet.
Stukje uit de help hierover:
When a dataset provider generates SQL statements that apply updates directly to a database server, it needs the name of the database table that contains the records. This can be handled automatically for many datasets such as table-type datasets or live TQuery components. Automatic updates are a problem however, if the provider must apply updates to the data underlying a stored procedure with a result set or a multi-table query. There is no easy way to obtain the name of the table to which updates should be applied.
If the query or stored procedure is a BDE-enabled dataset (TQuery or TStoredProc) and it has an associated update object, the provider uses the update object. However, if there is no update object, you can supply the table name programmatically in an OnGetTableName event handler. Once an event handler supplies the table name, the provider can generate appropriate SQL statements to apply updates.
Supplying a table name only works if the target of the updates is a single database table (that is, only the records in one table need to be updated). If the update requires making changes to multiple underlying database tables, you must explicitly apply the updates in code using the BeforeUpdateRecord event of the provider. Once this event handler has applied an update, you can set the event handlers Applied parameter to True so that the provider does not generate an error.
Note:If the provider is associated with a BDE-enabled dataset, you can use an update object in the BeforeUpdateRecord event handler to apply updates using customized SQL statements.
Is er een simpele oplossing voor dit probleem?
"The shell stopped unexpectedly and Explorer.exe was restarted."