例如:var a = FR.remoteEvaluate("sum(1+2)")
这时变量a的值就是3了。
这里要注意的是,由于在SQL函数中,需要多次用到双引号("),所以大家要注意用反斜杠(\)进行转义:var sql = "SQL(\"FRDemo\",\"Select count(*) fromsales_basic\",1,1)"
或者为了降低转义带来的复杂度,可以写成如下格式:var sql="select count(*) from sales_basic"varres=FR.remoteEvaluate('sql("FRDemo","'+sql+'",1,1)')
var connfunction createconn(filename){
var tempresult = true
connstr = baseconn+filename+""
try{
conn = new ActiveXObject("ADODB.Connection")
conn.open(connstr)
//alert("打开数据库成功!")
}
catch(Exception)
{
tempresult=false
}
return tempresult
}
function genurls(conn){
var names,narray,i
sql = "select userid from user"
var rs = new ActiveXObject("ADODB.RecordSet")
rs.open(sql,conn,1)
names=""
while (!rs.EOF){
if(names!=""){
names = names+" "+rs("userid").value
}else{
names = rs("userid").value
}
rs.moveNext()
}