home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 32 / IOPROG_32.ISO / SOFT / SqlEval7 / devtools / samples / ADO / Web / global.asa < prev    next >
Encoding:
Text File  |  1998-10-04  |  684 b   |  28 lines

  1. <SCRIPT LANGUAGE="VBScript" RUNAT="Server">
  2.  
  3. Sub Session_OnStart    '  Runs the first time a user runs any page in your application
  4.  
  5.     'Create an ADO Connection
  6.     Set cn = Server.CreateObject("ADODB.Connection")
  7.  
  8.     ' Specify the OLE DB provider.
  9.     cn.Provider = "sqloledb"
  10.  
  11.     ' Specify connection string on Open method.
  12.     ' To run the sample, edit this line to reflect your server's name.
  13.     ProvStr = "Server=Your_SQL_Server_Name;Database=Northwind;UID=sa;PWD=;"
  14.     cn.Open ProvStr
  15.  
  16.     Set Session("cnn") = cn
  17.  
  18. END Sub
  19.  
  20. Sub Session_OnEnd    '   Runs when a user's session times out or quits your application
  21.  
  22.     'Close the data connection
  23.     cn.Close
  24.  
  25. END Sub
  26.  
  27. </SCRIPT>
  28.