FUNCTION SetTableLocations PARAMETERS aTables oTables = ._oReport.Database.Tables ** Loop once for each array element FOR nTable1 = 1 TO ALEN(aTables, 1) ** Extract the table name and alias from the array cTable = aTables[nTable1, 1] cAlias = LOWER(ALLTRIM(aTables[nTable1, 2])) ** Loop once for each table in the collection FOR nTable2 = 1 TO oTables.Count ** Extract the table from the collection, and get the alias name oTable = oTables.Item(nTable2) cRptAlias = LOWER(ALLTRIM(oTable.Name)) ** If the report alias matches the array alias... IF cRptAlias = cAlias ** Change the data location oTable.Location = cTable ENDIF ENDFOR ENDFORI also tried this, from your website - no effect. I still get a
oRpt = ._oReport oDB = oRpt.Database ocDBT = oDB.Tables() oDBT = ocDBT.Item(1) oDBT.Location = aTables[1, 1] oDBT = ocDBT.Item(2) oDBT.Location = aTables[2, 1]After this code runs, the Location value is unchanged.