You don't specify what not working means. One thing to watch out for is to split script tags or you'll confuse the parser:
Code:
<%
Dim sName
sName = GetNameFromDatabase()
Dim sScript
sScript = "<scr" & "ipt type=""text/javascript""" & vbCrLf
sScript = sScript & "alert(""" & sName & "");" & vbCrLf
sScript = sScript & "</scr" & "ipt>" & vbCrLf
Response.Write sScript
%>
--
Joe