This is a multi-part message in MIME format.

------=_NextPart_000_01A1_01C0A32E.21E43180
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

=20
Hi,

Thanks for the info, but I'm afraid it isn't returning columns in =
order... especially for tables with more than five columns..

Below is the sample code that I am currently using.. please make the =
necessary corrections..

<cfquery name=3D"GetData" datasource=3D"#application.ourdsn#" =
dbtype=3D"ODBC">
   select * from tablename
</cfquery>
<htmL>
<body>
<table width=3D"100%" border=3D"1">
  <tr>
     <cfloop index=3D"ColName" list=3D"#GetData.ColumnList#">
     <th><cfoutput>#ColName#</cfoutput></th>
     </cfloop>
  </tr>
<cfoutput query=3D"GetData">
  <tr>
  <cfloop index=3D"ColName" list=3D"#GetData.ColumnList#">
     <td>#Evaluate(ColName)#</td>
  </cfloop>
  </tr>
</cfoutput>
</table>
</body>
</html>

Now, this cfm file is used to GET EXTERNAL DATA using MS EXCEL 2000, via =
the NEW WEB QUERY function of Excel.

Once I enter the cfm file, the Excel runs the URL of the cfm file and =
does the query... after a while, the results or data is outputted in the =
excel sheet perfectly as I wanted it, only that the columns are =
SOMETIMES not in order especially when the table has many columns.

Help will be very much appreciated..

Thanks,
Winston


------=_NextPart_000_01A1_01C0A32E.21E43180
Content-Type: text/html;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2919.6307" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff><FONT face=3DArial><FONT face=3DArial>&nbsp;
<DIV>Hi,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks for the info, but I'm afraid it isn't returning columns in =
order...=20
especially for tables with more than five columns..</DIV>
<DIV>&nbsp;</DIV>
<DIV>Below is the sample code that I am currently using.. please make =
the=20
necessary corrections..</DIV>
<DIV>&nbsp;</DIV>
<DIV>&lt;cfquery name=3D"GetData" datasource=3D"#application.ourdsn#"=20
dbtype=3D"ODBC"&gt;<BR>&nbsp;&nbsp; select * from=20
tablename<BR>&lt;/cfquery&gt;<BR>&lt;htmL&gt;<BR>&lt;body&gt;<BR>&lt;tabl=
e=20
width=3D"100%" border=3D"1"&gt;<BR>&nbsp; =
&lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;cfloop index=3D"ColName"=20
list=3D"#GetData.ColumnList#"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;th&gt;&lt;cfoutput&gt;#ColName#&lt;/cfoutput&gt;&lt;/th&gt;<BR>&nbsp;=
&nbsp;&nbsp;&nbsp;=20
&lt;/cfloop&gt;<BR>&nbsp; &lt;/tr&gt;<BR>&lt;cfoutput=20
query=3D"GetData"&gt;<BR>&nbsp; &lt;tr&gt;<BR>&nbsp; &lt;cfloop =
index=3D"ColName"=20
list=3D"#GetData.ColumnList#"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;td&gt;#Evaluate(ColName)#&lt;/td&gt;<BR>&nbsp; =
&lt;/cfloop&gt;<BR>&nbsp;=20
&lt;/tr&gt;<BR>&lt;/cfoutput&gt;<BR>&lt;/table&gt;<BR>&lt;/body&gt;<BR>&l=
t;/html&gt;<BR><BR>Now,=20
this cfm file is used to GET EXTERNAL DATA using MS EXCEL 2000, via the =
NEW WEB=20
QUERY function of Excel.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Once I enter the cfm file, the Excel runs the URL of the cfm file =
and does=20
the query... after a while, the results or data is outputted in the =
excel sheet=20
perfectly as I wanted it, only that the columns are SOMETIMES not in =
order=20
especially when the table has many columns.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Help will be very much appreciated..</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks,</DIV>
<DIV>Winston</DIV>
<DIV>&nbsp;</DIV>
<DIV></FONT></DIV></FONT></BODY></HTML>

------=_NextPart_000_01A1_01C0A32E.21E43180--


Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to