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

发表于:2007-06-30来源:作者:点击数: 标签:
可能要Jscript Version 5以上 SCRIPT RUNAT=SERVER Language= java script 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=
可能要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 ("suclearcase/" target="_blank" >ccessfully")
else
  Response.Write ("failed")
}
  
function print(s){
   Response.Write(s+"<br>");
}   
    
  
    
</script>

原文转自:http://www.ltesting.net