JS under system.data.connection V1

xiaoxiao2021-03-06  21

// public // --------------------------------------------- ------------------- // Name Begin Modifiy Description // Connection 2005-3-21 2005-3-21 System.Data.Connection Object Function System.Data.Connection () {This.Connection; this.State = -1; this.commandtext; this.commandType = CommandType.Text; this.recordsaffected = 0; // private // --------- -------------------------------------------------- ----- // Name Begin Modifiy Description // Isconnection 2005-1-28 2005-1-28 Check this.Connection = function () {if (this.State == -1) {this. Connection = Server.createObject ("AdoDb.Connection"); this.cursorLocation = aduseclient this.state = 0;} f (this.state == 0) {TRY {this.connection.open (this.connectionstring); this. State = 1;} catch (e) {new system.exception ("connection failed!" E.DESCRIPTION)}} return (this.state);} // public // ---------- -------------------------------------------------- ---- // Name Begin M odifiy Description // ExecuteNonQuery 2005-1-28 2005-1-28 execute SQL statements against the Connection and returns the number of rows affected this.ExecuteNonQuery = function (CommandText, CommandType) {this.CheckCommandText (CommandText); this.CheckCommandType (CommandType This.isconnection (); this.Connection.execute (this.Commandtext, this.recordsaffected, this.CommandType adexecutenorecords); return (this.recordsaffected);} // public // -------------- -------------------------------------------------- ------ // name begin Modifiy Description // ExecuteReader 2005-1-28 2005-1-28 Send CommandText to Connection and generates a DataReader.

this.ExecuteReader = function (CommandText, CommandType) {this.CheckCommandText (CommandText); this.CheckCommandType (CommandType); this.IsConnection (); return (this.Connection.Execute (this.CommandText, this.RecordsAffected, this.CommandType )));} // public // ----------------------------------------- ----------------------- // name begin Modifiy Description // ExecuteScalar 2005-1-28 2005-1-28 Executive query, return to the query The result of the first column of the first line. Ignore additional columns or rows. THIS.Executescalar = function (CommandText, CommandType) {Return (this.executeRead (CommandText, CommandType) (0));} // public // --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------- // Name Begin Modifiy Description // ExecuteExmlReader 2005-1-28 2005-1-28 Send CommandText to Connection and generates an XMLReader object. this.ExecuteXmlReader = function (CommandText, CommandType) {var Stream = Server.CreateObject ( "ADODB.Stream"); ​​this.ExecuteReader (CommandText, CommandType) .Save (Stream, adPersistXML); return (Stream.ReadText (-1) ); // var adreadall = -1

} // private // -------------------------------------------- -------------------- // Name Begin Modifiy Description // Checkcommandtext 2005-1-28 2005-1-28 Check CommandText this.checkcommandtext = function (CommandText) { IF (! Utility.iseMpty (CommandText) This.commandtext = CommandText;} //priVate // -------------------------------------------------------------------------------------------------------------------------------- ------------------------------------ // name begin modifi description // CheckcommandType 2005-1-28 2005-1-28 check CommandType this.checkcommandtype = function (commandtype) {if (! Utility.isempty (commandtype)) this.commandtype = commandType;} // public // ------------ -------------------------------------------------- - // Name Begin Modifiy Description // Close 2005-1-28 2005-1-28 Close Connection object this.close = function () {this.Connection.close ();} // public // ---- -------------------------------------------------- ---------- // name begin modifiy description // dispose 2005-3-18 2005-3-18 Destruction of the Connection object this.dispose = function () {THI S.Close (); this.connection = null;} // public // -------------------------------- -------------------------------- // name begin modely description // tString 2005-3-21 2005-3- 21 Getting the string representation of this example this.tostring = function () {return ("system.data.connection);} // private // ----------------- ---------------------------------------------- // name Begin Modifiy Description // CTOR 2005-3-21 2005-3-21 Holding this.ctor = function (arguments) {this.connectionstring = (! Utility.isempty (arguments [0]) && typeof (arguments [0] == "string")? arguments [0]: setup.appsettings ["connectionstring"];

转载请注明原文地址:https://www.9cbs.com/read-44630.html

New Post(0)