Am I a horrible person?

Results 1 to 2 of 2

Thread: Am I a horrible person?

  1. #1
    Join Date
    Dec 1969

    Default Am I a horrible person?

    I have an array with ID numbers in it. I want the associated name to be displayed on the page. The only way I can get it to work is to place the entire recordset inside the loop. I have a feeling that this is a horrible thing to do. <BR>It works properly like this but when I place it before the loop it only picks up the first record and repeats it.<BR>It seems like an easy thing to do but I&#039m not very experienced.<BR><BR>Dim iloop<BR> For iLoop = LBound(aPref) to UBound(aPref)<BR> <BR>strSource="SELECT SpecID, firstName, lastName "<BR>strSource=strSource & "FROM SpecID "<BR>strSource=strSource & "WHERE SpecID =&#039" & apref(iloop) & "&#039;"<BR>set oRSs=Server.CreateObject("ADODB.recordset")<BR>oRS strSource, oConn<BR><BR>response.write oRSs("firstName")<BR>response.write oRSs("SpecID")<BR><BR>.....<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: Am I a horrible person?

    Try joining ( as strList = Join(array, ",") ) the array with comma delimiter. Then use SQL systax Select ... where ID In strList . then loop thru the ResultSet.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts