这段代码不知谁还需要,但我很有用,在此感谢hooke
<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>
Tags:
作者:佚名评论内容只代表网友观点,与本站立场无关!
评论摘要(共 0 条,得分 0 分,平均 0 分)
查看完整评论