网站首页/技术开发列表/内容

这段代码不知谁还需要,但我很实用,在此感谢hooke

技术开发2021-02-19阅读
可能要Jscript Version 5以上

<SCRIPT RUNAT=SERVER Language=javascript>
 var oConn;
 var Rs;
 var empID=3;
 var err_flag; //错误旗标
try { 
 oConn = Server.CreateObject("ADODB.Connection");
 oConn.Open("DSN=sybase1;uid=sa;pwd=;database=mydatabase");

Rs=oConn.Execute ( " Select * from Operator_Info where Op_ID="+ empID +"" );
 
}
catch(e){
//如果有错
err_flag=1
print(e)
}
finally {
if (!err_flag)
Response.Write ("successfully")
else
Response.Write ("failed")
}

function print(s){
 Response.Write(s+"<br>");




</script>

……

相关阅读