Hello - 

I have posted this question on an ASP board to no avail.  My question regards 
translating classic asp code to coldfusion 8.  My problem is I don't completely 
understand the asp code in order to create the CF code.  I am hoping the 
community can help me out as always.

This is the classic asp code:

/////////////////////////////
clientPreReg=","
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open Application("database")
Set rs = Server.CreateObject("ADODB.Recordset")
set rs.ActiveConnection = conn
strQ = "SELECT * "
strQ = strQ & "FROM eventAttendance "
strQ = strQ & "WHERE clientID =" & client & ""
rs.Open strQ
if rs.eof then
        clientPreReg=","
else
        do while not rs.eof
                clientPreReg=clientPreReg & rs("eventID") & ","
                rs.moveNext
        loop
        clientPreRegCount=Len(clientPreReg)
        clientPreReg=Mid(clientPreReg, 2, clientPreRegCount-2)
        clientPreRegArray=split(clientPreReg,",")
end if
rs.close
///////////////////

What I think is going on is:

  Set a variable called "clientPreReg"
      clientPreReg=","

  Create a database connection, select all records from eventAttendance where 
clientID equals the variable "client."
      Set Conn = Server.CreateObject("ADODB.Connection")
      Conn.open Application("database")
      Set rs = Server.CreateObject("ADODB.Recordset")
      set rs.ActiveConnection = conn
      strQ = "SELECT * "
      strQ = strQ & "FROM eventAttendance "
      strQ = strQ & "WHERE clientID =" & client & ""
      rs.Open strQ

  If I'm at the end of file, leave "clientPreReg" empty:
      if rs.eof then
        clientPreReg=","

  If I'm not at the end of file, append "clientPreReg" with eventID value and 
another comma. Do this for all (rs.moveNext):
      else
        do while not rs.eof
                clientPreReg=clientPreReg & rs("eventID") & ","
                rs.moveNext

Loop through the "clientPreReg" array and removed commas:
      loop
        clientPreRegCount=Len(clientPreReg)
        clientPreReg=Mid(clientPreReg, 2, clientPreRegCount-2)
        clientPreRegArray=split(clientPreReg,",")

I need to understand what is going on before I can convert this into CF.  I 
understand this isn't the place for ASP, but it has been a great help in the 
past.

Thank you,
Adam 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4376
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to