I have done this before, but have never heard someone suggest doing it. Maybe there's a good reason that I haven't heard it suggested before, but here goes:
You can incorporate both together by using VBScript to write out the
JS, just like you can use it to generate HTML. Example:
<%
Response.Write "<script language='JavaScript'>" & chr(10) & chr(13)
Response.Write "function sampleJS () {" & chr(10) & chr(13)
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "TableName", sConnect, adOpenStatic, adLockOptimistic, adCmdTable
While Not rs.eof
Response.Write "document.write 'here is the first field: '" & rs("SampleField") & chr(10) & chr(13)
rs.MoveNext
Wend
Response.Write "}" & chr(10) & chr(13)
Response.Write "</script>"
I hope that helps.