UpdatingTable and current/default schema
Posted: Wed 15 Jun 2016 16:40
Hello,
'til now you answered my questions just fine so here's the next challenge
When setting the property UpdatingTable it seems that it has to match the way the table is declared in the query. This is rather unfortunate if you are using the current schema.
For example this works fine:
just like this:
But this fails with 'Wrong UpdatingTable value - table Table is unknown':
With Ado we used the property 'Unique Table' for which UpdatingTable seems to be the replacement and it worked fine in all this situations.
I also found a relatively easy fix by replacing the line MSClasses.GenerateTableName 660
with
Though this doesn't check for the DEFAULT_SCHEMA of the current user...
'til now you answered my questions just fine so here's the next challenge
When setting the property UpdatingTable it seems that it has to match the way the table is declared in the query. This is rather unfortunate if you are using the current schema.
For example this works fine:
Code: Select all
qu.SQL.Text := 'SELECT * FROM DBO.[Table]';
qu.Open;
qu.UpdatingTable := 'dbo.Table';
Code: Select all
qu.SQL.Text := 'SELECT * FROM [Table]';
qu.Open;
qu.UpdatingTable := 'Table';
Code: Select all
qu.SQL.Text := 'SELECT * FROM DBO.[Table]';
qu.Open;
qu.UpdatingTable := 'Table';
Code: Select all
TAdoQuery.Recordset.Properties['Unique Table'].Value := UpdatingTable;
Code: Select all
if SchemaName <> '' then
Code: Select all
if (SchemaName <> '') and not SameText(SchemaName, DefaultSDACSchema) then