请教:ASP中怎样使函数值作为SQL查询的一个条件
自己写的代码如下:<!--#include file="xyz.asp" -->
<script type="text/javascript" language="javascript">
<!--
function GetLocalIPAddress()
{
var obj = null;
var rslt = "";
try
{
obj = new ActiveXObject("rcbdyctl.Setting");
rslt = obj.GetIPAddress;
obj = null;
}
catch(e)
{
//异常发生
}
return rslt;
}
document.write("你的IP是:" + GetLocalIPAddress());
ip= GetLocalIPAddress();
//-->
</script>
<%
var conn = Server.CreateObject("ADODB.Connection");
conn.Open("driver={SQL Server};database=dm;server=127.0.0.1;uid=sa;pwd=123");
rs = conn.Execute( "select * from dm1 where a2='"+ip+"' " );
rsToTable (rs);
conn.close();
%>