Mega Code Archive

 
Categories / Delphi / Examples
 

Unable to resolve records table name not found

Question: I'm using ClientDatasets and my query has results from 2 tables. How come when I insert, delete or update records I get the error "Unable to resolve records. Table name not found"? I've run SQL Monitor and notice that the UPDATE statement just says WHERE w. Answer: To update multiple tables you must generate the SQL yourself. If you have Delphi 3, you can use an UpdateSQLProvider. If you have Delphi 4 you must create 3 TQueries (One each for INSERT, DELETE and UPDATE statements). From the TProviders BeforeUpdateRecord event determine which query to use by the updatekind parameter and then execute the appropriate query (populating the parameters along the way).