home *** CD-ROM | disk | FTP | other *** search
- <SCRIPT LANGUAGE="VBScript" RUNAT="Server">
-
- Sub Session_OnStart ' Runs the first time a user runs any page in your application
-
- 'Create an ADO Connection
- Set cn = Server.CreateObject("ADODB.Connection")
-
- ' Specify the OLE DB provider.
- cn.Provider = "sqloledb"
-
- ' Specify connection string on Open method.
- ' To run the sample, edit this line to reflect your server's name.
- ProvStr = "Server=Your_SQL_Server_Name;Database=Northwind;UID=sa;PWD=;"
- cn.Open ProvStr
-
- Set Session("cnn") = cn
-
- END Sub
-
- Sub Session_OnEnd ' Runs when a user's session times out or quits your application
-
- 'Close the data connection
- cn.Close
-
- END Sub
-
- </SCRIPT>
-