Here is the code:

<cfset CurrentPage=GetFileFromPath(GetTemplatePath())>
<cfparam name="PageNum_rsSongSelect" default="1">
<cfquery name="rsSongSelect" datasource="BahaiMusic"
username="bahaimusicadmin" password="xxx">
SELECT ID, Songtitle, Author, Style, Tempo, Lyrics FROM dbo.tbl_songs
</cfquery>
<cfset MaxRows_rsSongSelect=10>
<cfset
StartRow_rsSongSelect=Min((PageNum_rsSongSelect-1)*MaxRows_rsSongSelect+1,Ma
x(rsSongSelect.RecordCount,1))>
<cfset
EndRow_rsSongSelect=Min(StartRow_rsSongSelect+MaxRows_rsSongSelect-1,rsSongS
elect.RecordCount)>
<cfset
TotalPages_rsSongSelect=Ceiling(rsSongSelect.RecordCount/MaxRows_rsSongSelec
t)>
<cfset QueryString_rsSongSelect=Iif(CGI.QUERY_STRING NEQ
"",DE("&"&CGI.QUERY_STRING),DE(""))>
<cfset
tempPos=ListContainsNoCase(QueryString_rsSongSelect,"PageNum_rsSongSelect=",
"&")>
<cfif tempPos NEQ 0>
  <cfset
QueryString_rsSongSelect=ListDeleteAt(QueryString_rsSongSelect,tempPos,"&")>
</cfif>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
<title>Select a song | Baha'i Music</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>

<body>
<p>Select a song</p>
<p>&nbsp;</p>

<table border="1" align="center">
  <tr>
    <td>Songtitle</td>
    <td>Style</td>
    <td>Tempo</td>
  </tr>
  <cfoutput query="rsSongSelect" startRow="#StartRow_rsSongSelect#"
maxRows="#MaxRows_rsSongSelect#">
    <tr>
      <td><a
href="songview.cfm?recordID=#rsSongSelect.ID#">#rsSongSelect.Songtitle#
</a></td>
      <td>#rsSongSelect.Style# </td>
      <td>#rsSongSelect.Tempo# </td>
    </tr>
  </cfoutput>
</table>
<br>
<table border="0" width="50%" align="center">
  <cfoutput>
    <tr>
      <td width="23%" align="center"> <cfif PageNum_rsSongSelect GT 1>
          <a
href="#CurrentPage#?PageNum_rsSongSelect=1#QueryString_rsSongSelect#">First<
/a>
        </cfif> </td>
      <td width="31%" align="center"> <cfif PageNum_rsSongSelect GT 1>
          <a
href="#CurrentPage#?PageNum_rsSongSelect=#Max(DecrementValue(PageNum_rsSongS
elect),1)##QueryString_rsSongSelect#">Previous</a>
        </cfif> </td>
      <td width="23%" align="center"> <cfif PageNum_rsSongSelect LT
TotalPages_rsSongSelect>
          <a
href="#CurrentPage#?PageNum_rsSongSelect=#Min(IncrementValue(PageNum_rsSongS
elect),TotalPages_rsSongSelect)##QueryString_rsSongSelect#">Next</a>
        </cfif> </td>
      <td width="23%" align="center"> <cfif PageNum_rsSongSelect LT
TotalPages_rsSongSelect>
          <a
href="#CurrentPage#?PageNum_rsSongSelect=#TotalPages_rsSongSelect##QueryStri
ng_rsSongSelect#">Last</a>
        </cfif> </td>
    </tr>
  </cfoutput>
</table>
<cfoutput>Records #StartRow_rsSongSelect# to #EndRow_rsSongSelect# of
#rsSongSelect.RecordCount# </cfoutput>
</body>
</html>

Mitko Gerensky-Greene

****************************************************************
"Make no search for water. But find thirst,
And water from the very ground will burst."
(A Persian mystic poet, quoted in Delight of Hearts, p. 77)

"The world is but one country and mankind its citizens"
Baha'i Faith
http://www.us.bahai.org
*****************************************************************
----- Original Message -----
From: "Sean A Corfield" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Saturday, August 17, 2002 10:33 PM
Subject: Re: Another beginner's question - recordset lists double fields


You need to show us your code so we can figure out what's wrong...

On Saturday, August 17, 2002, at 07:09 , Mitko Gerensky-Greene wrote:
> I am trying to use DW MX to create a small CF application. I am working
> with a SQL Server database where I created a login called bmadmin to
> administer this particular table. When creating a recordset in DW MX for
> some odd reason it lists the same table twice -- dbo.tbl_songs and
> bmadmin.tbl_songs. In addition the fields of the table are listed twice,
> i.e. ID, title, lyrics, ID, title, lyrics.
> What is the problem and how to fix it?
>
> Thanks,
>
> Mitko Gerensky-Greene

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood


______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to