Well, u can't run sql statement from client side.
When u use event u R doing it in client side.
So u should have another asp page that runs the sql u like,
and need to call this page after u assign it the js variable.
Say the current page called: "first.asp", and second called "sqlStat.asp".
*********first.asp*****************
function someFunction()
{
var whichDevice = MainForm.device.options
[MainForm.device.selectedIndex].value
window.location.href="sqlStat.asp?whichDeviceJS="+whichDevice;
}
**********************************
*************sqlStat.asp************
<%@ Language=VBScript %>
<HTML>...
<body>
<%
dim whichdeviceVBS
whichdeviceVBS=request("whichDeviceJS")
strSQL = "SELECT * FROM someTable WHERE whichDeviceVBS ETC."
%>
</body>
</html>
************************************