- see footer for list info -<
Does anyone know how I can retrieve the data from an excel datasource in the order they are on the spreadsheet. For some reason everything seems to come back alphabetically ....

I have this ....

<cfquery name="GetExcelSheet" datasource="cfpagesexcel">
  SELECT *
  FROM [DataSheet$]
IN 'c:\documents and settings\administrator\desktop\ExcelDataSource.xls' 'EXCEL 5.0;'
</cfquery>

<!---
<cfdump var="#testQuery#">
--->

<!--- Get the number of columns and records to build our grid --->
<CFSET Columns = ListLen(GetExcelSheet.ColumnList)>
<CFSET Records = GetExcelSheet.RecordCount>


<!--- Output the data --->
<CFLOOP FROM="1" TO="#Columns#" INDEX="x">
 <cfset ColumnHeader[x] = ListGetAt(getExcelSheet.ColumnList, x)>
</CFLOOP>

<CFLOOP FROM="1" TO="#Columns#" INDEX="x">
 <table border=1>
   <tr>
     <td>
       <cfoutput>#ColumnHeader[x]#</cfoutput>
     </td>
   </tr>
 </table>
</cfloop>


_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
- Hosting provided by www.cfmxhosting.co.uk -<
- Forum provided by www.fusetalk.com -<
- DHTML Menus provided by www.APYCOM.com -<
- Lists hosted by www.Gradwell.com -<
- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to