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

导读:
  可能要Jscript Version 5以上
  
  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+"
");
  }
  
  
  
  

本文转自
http://study.qqcf.com/web/243/29303.htm

你可能感兴趣的:(Web)