sql="select toname,isread,adddate from talks where toname='"& username &"'and isread=0 order by adddate" set rs=conn.execute(sql) if not rs.eof then response.write "<script>window.open('showmessage.asp','','width=580,height=400,scrollbars=yes')</script>" end if rs.close set rs=nothing conn.close set conn=nothing