Web Application Development Advice & How To
Active Server Pages Development Advice & How To

Shining Star Services LLC
Shining Star Services
ASP.net Articles
HTML Tutorial
Auto-select an Element from a Menu or Scrolling List & Save Keystrokes!
ASP Driven DHTML Slider Menus REVISITED One Year Later! Part II
ASP Driven DHTML Slider Menus
ASP Driven HTML Outlines
Reusing Code with ASP Include Files and Subroutines
Hacker Query Check
.htr IIS Security Issue
Databases, Cookies
Functions to Open a Database Connection and Record Set
Setting Up and Using OraSession to Manage Your Oracle Database Objects
Storing Non-Durable Data for Cookie-less Sessions
Smart Popups
Javascript: Validate Numeric Fields
Javascript Confirm Form Submission
Javascript Dynamic Text Area Counter
Javascript: Check All and Uncheck All Check Boxes
Javascript Field Validations -- Client Side Scripting
Tree Select Demo
Adobe Extension Manager
Scandisk & Defrag Pointers
Standards & Style
Setting Up Your Own ASP Development Templates
Creating a Project Template for Estimations of Time, Tasks, and Resources
To Host or Not To Host
ASP Naming Conventions
HTML Naming Conventions & Visual Interdev HTML Generation
Working with and in spite of the Visual Interdev Design Mode
Commenting Your ASP Source Code
Reader Letters

Articles Home

Shining Star Services

Setting Up and Using OraSession to Manage Your Oracle Database Objects
By Nannette Thacker - 05/01/1999

Most ASP developers are familiar with data connections using ActiveX Data Objects (ADO). However, Oracle provides the OraSession object to manage collections of OraConnection, OraDatabase, and OraDynaset objects used within your application.

You must first create a data control using Oracle's SQL*Net Easy Configuration. Select SQL*Net Easy Configuration from your Program menu.

SQL*Net Menu

Select the radio button to "Add Database Alias." Then select "OK."

Add Database Alias

Type in the name of the alias to identify the database you wish to access. This can be any name you wish to give it.

Database Alias

Select the Protocol.

Type in either the Host Name or IP address of the server and the Database Instance.

Database Instance

Then confirm the addition of this instance:

Confirm addition

Now you are ready to use this connection in your ASP pages. I create include files (with an .asp extension) to open and close my data connections. In the database.asp include file I would include functions to open and close the data connections. The include file would be included at the top of the asp page which utilizes data connections. Then, the open and close functions could be called as needed:

' Declare OLE object variables
Dim ses As Object	
Dim db As Object
Sub DataOpen
   ' Create the OraSession Object

set ses = CreateObject("OracleInProcServer.XOraSession")
   ' Open a connection to Oracle
   set db = ses.OpenDatabase("DemoDB","Username/Password",0)      
End Sub
Sub DataClose
   ' Close the connection
   Set db = Nothing
End Sub
When you are ready to call these functions, include the database.asp file in your ASP page and call them where needed:
<!--#include virtual="/include/database.asp"-->


ShiningStar.net | ShiningStarSingles.com | Christian911.com