The below code works just fine in CF5, but trying to port this code over to CF MX7 it clears all arrays and there is no data in the multi-dimenional array. It seems like it should put the array data into the Struct then clear it out for the next loop, but it appears to clear the data out of the Struct. Any ideas?
<!---Start Code--->
<!--- query for taking TableNames--->
<cfquery name="GetTableNames" Datasource=#application.Datasource#>
SELECT DISTINCT(TableName)
FROM cc_Profile_Column
WHERE TableName <> 'Address'
</cfquery>
<!---looping all tables and storing values in session--->
<cfloop query="GetTableNames">
<cfset l_TableName=GetTableNames.TableName>
<!--- Getting column names based on the tablename--->
<cfquery name="GetColumnNames" Datasource=#application.Datasource#>
SELECT ColumnName
FROM cc_Profile_Column
WHERE Tablename='#l_TableName#'
ORDER BY SortOrder
</cfquery>
<!--- Storing all columnnames in list l_SetAllColumns--->
<cfloop query="GetColumnNames">
<cfset l_SetAllColumns="#ValueList(GetColumnNames.ColumnName)#">
</cfloop>
<!--- Fetching records from contact table--->
<cfquery name=#l_TableName# Datasource=#application.Datasource#>
SELECT #l_SetAllColumns#
FROM #l_TableName#
WHERE ContactID=#l_ContactID#
</cfquery>
<!--- checking if record exists--->
<cfset GetRecordCount="#l_TableName#.RecordCount">
<cfif #Evaluate(GetRecordCount)#>
<!--- Executing query storing each row in datastructure and further storing data structutre(s) into session.ProfileData array--->
<cfloop query="#l_TableName#">
<cfset l_counter=l_counter+1>
<!--- Converting list of columnnames into array--->
<cfset l_ColumnNamesArray=ListtoArray(l_SetAllColumns)>
<cfloop index="i" from = "1" to = "#ArrayLen(l_ColumnNamesArray)#">
<cfset QueryVar="#l_TableName#.#l_ColumnNamesArray#">
<!--- storing database values in array--->
<cfset l_DbValues=Evaluate(QueryVar)>
</cfloop>
<!--- initilaizing the structure, intializing inside cfoutput query so as to make seperate datastrctures for each row --->
<cfset l_RowName =StructNew()>
<!--- inserting data in structure--->
<cfset value=StructInsert(l_RowName, "Key", "#l_TableName#:#l_DbValues[1]#")>
<cfset value=StructInsert(l_RowName, "Action", "")>
<cfset value=StructInsert(l_RowName, "DatabaseValues", "#l_DbValues#")>
<cfset value=StructInsert(l_RowName, "sessionValues", "#l_DbValues#")>
<!--- Strong data Structutre in main session.ProfileData array--->
<cfif session.AdministratorID GT 0>
<cfset session.ProfileData[l_Counter]=l_RowName>
<cfelse>
<cfset session.ProfileDataNotEditable[l_Counter]=l_RowName>
</cfif>
<!--- Clearing array so blank array is used next time--->
<cfset l_ArrayClean=ArrayClear(l_DbValues)>
</cfloop>
</cfif>
<cfset l_SetAllColumns="">
<cfset l_ArrayClean=ArrayClear(l_ColumnNamesArray)>
</cfloop>
<!---Start Code--->
<!--- query for taking TableNames--->
<cfquery name="GetTableNames" Datasource=#application.Datasource#>
SELECT DISTINCT(TableName)
FROM cc_Profile_Column
WHERE TableName <> 'Address'
</cfquery>
<!---looping all tables and storing values in session--->
<cfloop query="GetTableNames">
<cfset l_TableName=GetTableNames.TableName>
<!--- Getting column names based on the tablename--->
<cfquery name="GetColumnNames" Datasource=#application.Datasource#>
SELECT ColumnName
FROM cc_Profile_Column
WHERE Tablename='#l_TableName#'
ORDER BY SortOrder
</cfquery>
<!--- Storing all columnnames in list l_SetAllColumns--->
<cfloop query="GetColumnNames">
<cfset l_SetAllColumns="#ValueList(GetColumnNames.ColumnName)#">
</cfloop>
<!--- Fetching records from contact table--->
<cfquery name=#l_TableName# Datasource=#application.Datasource#>
SELECT #l_SetAllColumns#
FROM #l_TableName#
WHERE ContactID=#l_ContactID#
</cfquery>
<!--- checking if record exists--->
<cfset GetRecordCount="#l_TableName#.RecordCount">
<cfif #Evaluate(GetRecordCount)#>
<!--- Executing query storing each row in datastructure and further storing data structutre(s) into session.ProfileData array--->
<cfloop query="#l_TableName#">
<cfset l_counter=l_counter+1>
<!--- Converting list of columnnames into array--->
<cfset l_ColumnNamesArray=ListtoArray(l_SetAllColumns)>
<cfloop index="i" from = "1" to = "#ArrayLen(l_ColumnNamesArray)#">
<cfset QueryVar="#l_TableName#.#l_ColumnNamesArray#">
<!--- storing database values in array--->
<cfset l_DbValues=Evaluate(QueryVar)>
</cfloop>
<!--- initilaizing the structure, intializing inside cfoutput query so as to make seperate datastrctures for each row --->
<cfset l_RowName =StructNew()>
<!--- inserting data in structure--->
<cfset value=StructInsert(l_RowName, "Key", "#l_TableName#:#l_DbValues[1]#")>
<cfset value=StructInsert(l_RowName, "Action", "")>
<cfset value=StructInsert(l_RowName, "DatabaseValues", "#l_DbValues#")>
<cfset value=StructInsert(l_RowName, "sessionValues", "#l_DbValues#")>
<!--- Strong data Structutre in main session.ProfileData array--->
<cfif session.AdministratorID GT 0>
<cfset session.ProfileData[l_Counter]=l_RowName>
<cfelse>
<cfset session.ProfileDataNotEditable[l_Counter]=l_RowName>
</cfif>
<!--- Clearing array so blank array is used next time--->
<cfset l_ArrayClean=ArrayClear(l_DbValues)>
</cfloop>
</cfif>
<cfset l_SetAllColumns="">
<cfset l_ArrayClean=ArrayClear(l_ColumnNamesArray)>
</cfloop>