[thelist] ASP Brain Teaser
Ken Schaefer
Ken at adOpenStatic.com
Mon Jul 10 18:19:22 CDT 2006
1) As Chris says "What is the code attempting to do"? Just post some
functional specs.
2) Have you attached a debugger and stepped through the code. That will make
it obvious why a certain code path is being hit more tha once.
--
My IIS Blog: www.adOpenStatic.com/cs/blogs/ken
Tech.Ed Sydney: learn all about IIS 7.0 - See you there!
: -----Original Message-----
: From: thelist-bounces at lists.evolt.org [mailto:thelist-
: bounces at lists.evolt.org] On Behalf Of Brian Delaney
: Sent: Tuesday, 11 July 2006 2:24 AM
: To: thelist at lists.evolt.org
: Subject: [thelist] ASP Brain Teaser
:
: This code always prints the first html line twice and the others only
: once. The first line is correct - checked and the repeat of it is show
: not checked. The second repeat needs to be removed. If someone one can
: tell me what to do to catch that I would appreciate it, thanks.
:
: Call OpenResourceCatalogDBConn()
: Set rsCatagoryList = Server.CreateObject("ADODB.Recordset")
: strSQL = "Select name,id from categories order by name "
: rsCatagoryList.Open strSQL, ResourceCatalogDBConn
: Dim ServicesArray,vtrue
: ServicesArray = split(serviceidlist, " ")
:
: rsCatagoryList.MoveFirst
: 'vtrue = "0"
:
: '1st service
: Set rsServiceList = Server.CreateObject("ADODB.Recordset")
: strSQL1 = "Select * from Services where catagoryid = " & "'" &
: mid(rsCatagoryList("ID"),2,36) & "'" & " order by name "
: rsServiceList.Open strSQL1, ResourceCatalogDBConn
:
: Do While Not rsServiceList.EOF
: For Icounter = 0 to Ubound(ServicesArray)
: If mid(rsServiceList("ID"),2,36) =
: ServicesArray(Icounter) Then
: servicelistHTML = servicelistHTML & "<input
: id=checkboxs type=checkbox value= " & mid(rsServiceList("ID"),2,36) & "
: name=checkboxs
: checked> "
: servicelistHTML = servicelistHTML &
: rsServiceList("Name") & "<br>"
: vtrue = true
: else
: vtrue = false
: end if
:
: Next
: if vtrue <> true then
: servicelistHTML = servicelistHTML & "<input
: id=checkboxs type=checkbox value= " & mid(rsServiceList("ID"),2,36) & "
:
: name=checkboxs> "
: servicelistHTML = servicelistHTML &
: rsServiceList("Name") & "<br>"
: end if
: rsServiceList.MoveNext
: Loop
:
: '2nd service
: rsCatagoryList.MoveNext
: 'vtrue = "0"
: everything repeats for this and the other services..
: ....................
:
:
: Thanks,
: Brian
More information about the thelist
mailing list