JScript and ADO objects

Results 1 to 2 of 2

Thread: JScript and ADO objects

  1. #1
    Join Date
    Dec 1969

    Default JScript and ADO objects

    Has anyone got a good reference for manipulating ADO objects via SERVER Jscript?

  2. #2
    Richard A. Lowe Guest

    Default RE: JScript and ADO objects

    There isn&#039;t much to know other than the JScript syntax for handling object like always using () on method calls.<BR><BR>The only 2 places I can see there being a problem is if you <BR>a) want to disconnect a recordset (example code below)<BR>b) get data using GetRows()<BR><BR>Other than those, the syntax is that of ADO in JScript:<BR>Example:<BR>&#060;script language="JavaScript" runat="Server"&#062;<BR> var oRS = Server.CreateObject(&#039;ADODB.Recordset&#039;);< BR> var Nothing = oRS.ActiveConnection;<BR> var oRS = Nothing;<BR><BR> // ~~~ Constants used in the classes ~~~ //<BR><BR> //---- CursorTypeEnum Values ----<BR> var adOpenForwardOnly = 0;<BR> var adOpenKeyset = 1;<BR> var adOpenDynamic = 2;<BR> var adOpenStatic = 3;<BR> //---- CursorLocationEnum Values ----<BR> var adUseServer = 2;<BR> var adUseClient = 3;<BR> //---- LockTypeEnum Values ----<BR> var adLockReadOnly = 1;<BR> var adLockPessimistic = 2;<BR> var adLockOptimistic = 3;<BR> var adLockBatchOptimistic = 4;<BR> //---- GetString Values ----<BR> var adClipString = 2;<BR> //----<BR> var adAsyncExecute = 16;<BR><BR> function mGetRecordset(strSQL) {<BR> try {<BR> var objRS = Server.CreateObject(&#039;ADODB.Recordset&#039;);< BR><BR> objRS.CursorLocation = adUseClient;<BR> objRS.Open(strSQL, this.Connection);<BR> objRS.ActiveConnection = Nothing;<BR> return objRS;<BR> }<BR> catch(e) {<BR> var err = Error();<BR> err.ErrObject = e;<BR> err.DisplayError();<BR> }<BR> }<BR>&#060;/script&#062;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts