
February 11th, 2003, 04:38 PM
|
|
Contributing User
|
|
Join Date: Apr 2002
Location: The Great White North
Posts: 361
Time spent in forums: 58 m 50 sec
Reputation Power: 8
|
|
I got it to work eventually, although it's not pretty.
Code:
set oRS = GetRS(sConn, "usp_GetLinkCategories @lid =" & iLID)
sCategorySelect = ""
while not (oRS.eof or oRS.bof)
sCategorySelect = sCategorySelect+ cstr(oRS("CategoryID")) + ","
oRS.movenext
wend
if "" & sCategorySelect <>"" then
sCategorySelect = left(sCategorySelect,len(sCategorySelect)-1)
End if
'Response.Write sCategorySelect
y= split(sCategorySelect,",")
aCat = GetArrRS(sConn,"usp_ListCategories")
sCategorySelect = "<Select name=""sCategorySelect"" multiple>"
If IsArray(aCat) then
for j = 0 to Ubound(aCat, 2)
sCategorySelect = sCategorySelect & "<option value=""" & aCat(0, j) & """"
for i = 0 to Ubound(y)
if cint(y(i))=aCat(0, j) then
sCategorySelect = sCategorySelect + " selected "
exit for
End if
Next
sCategorySelect = sCategorySelect + ">" + aCat(1, j)
sCategorySelect = sCategorySelect & "</option>"
Next
End if
sCategorySelect= sCategorySelect & "</select>"
Presumably there is a shorter way. If anybody has any better suggestions, I'm all ears!
|