Home DADE
New Blog Posts: Merging Reports - Part 1 and Part 2

Sql Server Table Alias possible fix

edited March 2003 in DADE
Environment running 6.03 (I have 7 I just have upgraded yet)
Running Delphi 6 Enterprise
Windows 2000.
Databases Sql Server 2000/Interbase/Firebird

I have been getting AV's on sql server only reports that are about 3
dataviews deep.
I pinpointed the problem to the below code. the below code gets around the
problem.
But really doesnt solve why the tablealias is wrong.


procedure TdaMagicLinks.ValidateMasterSQLFieldNames;

#323 // The lOrderByField.TableSQLAlias is not pass in the correct
tablealias
lTable :=
FMagicSQL.GetTableForSQLAlias(lOrderByField.TableSQLAlias);

#329
if (lTable <> nil) then
lSelectField := lTempSQL.AddSelectField(lTable,
lOrderByField.FieldName);

I have found the MagicSql error it, I have added
if (lTable <> nil) then

this bit of code is passing in lOrderByField.TableSQLAlias
it is strange as it only occurs on at least 3 levels
deep table connected. It is passing in the Table alias not
original Table
lTable := FMagicSQL.GetTableForSQLAlias(lOrderByField.TableSQLAlias);

thanx
Dave
david.szkilnyk@hr3.com.au

Comments

This discussion has been closed.