Is this function known to distrupt loops counters?
I have a loop and in that loop I have Member ID's.
I'm trying to convert them to their respective username.
Everytime the counter variable, which is i, hits that function; it gets set to the number 5.
When I take out the getMemberName() function, all works again.
wtf?
Good Preview - Without the getMemberName()
http://www.twistingshadows.com/userimages/good.html
Bad Preview - With the getMemberName()
http://www.twistingshadows.com/userimages/bad.html
Good HTML
http://www.twistingshadows.com/userimages/good.txt
Bad HTML
http://www.twistingshadows.com/userimages/bad.txt
First code snippet is a chunck that you see in the screenshots.
Just displays information. You see the isAvatarOwner(File.Name) calls my function below.
Then the pain starts.
'=== Determine the Type of User ===
Select Case (mLev)
Case 4
StringBuilder.AddString " <td align=""center"" width=""20%"" style=""border-style: solid; border-color: " & strPopUpBorderColor & "; border-width: 1px 0px 1px 0px; border-collapse: separate;"">" & vbCRLF
StringBuilder.AddString " <span alt=""Click to delete image."" title=""Click to delete item."">" & scriptDelete & "</span></font><br>" & vbCRLF
StringBuilder.AddString " <table width=""" & intAvatarWidth & """ height=""" & intAvatarHeight & """ cellspacing=""0"" cellpadding=""0"" border=""0"" style=""background-image: url('" & fullpath & "');background-repeat: no-repeat; background-position: center;"">" & vbCRLF
StringBuilder.AddString " <tr>" & vbCRLF
StringBuilder.AddString " <td align=""center""><span alt=""Click to assign yourself this Avatar."" title=""Click to assign yourself this Avatar."">" & scriptAssign & "</span></td>" & vbCRLF
StringBuilder.AddString " </tr>" & vbCRLF
StringBuilder.AddString " </table>" & vbCRLF
StringBuilder.AddString " <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & File.Name & "<br>Owner: " & isAvatarOwner(File.Name) & "</font>" & vbCRLF
StringBuilder.AddString " </td>" & vbCRLF
Case Else: '=== Do Nothing ===
End Select
Function isAvatarOwner(ThisAvatar)
Dim strSql, rsGetMembersAvatar
Dim avatarData
strSql = "SELECT A_URL, A_MEMBER_ID "
strSql = strSql & "FROM FORUM_AVATAR "
strSql = strSql & "WHERE A_URL = '" & avatarFolderPath & privateFolderName & "/" & ThisAvatar & "'"
Set rsGetMembersAvatar = Server.CreateObject("ADODB.Recordset")
'=== Open Database Connection ===
rsGetMembersAvatar.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
'=== Check For A Record ===
Select Case (rsGetMembersAvatar.EOF)
Case True: isAvatarOwner = "N/A"
Case Else
avatarData = rsGetMembersAvatar.GetRows()
isAvatarOwner = getMemberName(avatarData(1, 0))
End Select
'=== Clear Memory ===
rsGetMembersAvatar.Close
Set rsGetMembersAvatar = Nothing
Exit Function
End Function
The reason why I say loop counters is because I have code
that checks the loop counter to know when to end the table row.
If the function keeps setting it to 5 then either will happen:
a. Table never ends
b. Table always ends.
In the code you see the table always ends. Gah....