This article was previously published under Q240337
This article has been archived. It is offered "as is" and will no longer be updated.
This article shows how to use a Recordset Design-Time Control (DTC) to call an Oracle stored procedure, pass parameters, and retrieve recordsets.
This article assumes that you are familiar with the procedure to use ActiveX Data Objects (ADO) in an Active Server Page (ASP) page to call an Oracle package.
For more information on calling an Oracle package in ASP, see the "References" section of this article.
This article also assumes that Internet Information Server (IIS) and the development workstation are configured properly to connect to an Oracle database server. See "References" for more information on configuring IIS to connect to Oracle.
The procedure described in this article uses the PERSON table and PACKPERSON package. See "References" for instructions on their creation. You must create the PERSON table and PACKPERSON package before you use the procedure.
To Add a Data Connection
From the Project menu, choose Add Data Connection.
In the Data Link Properties dialog box, select Microsoft OLE DB Provider for ODBC drivers, and then click Next >>.
Choose Use data source name and provide the system DSN that was created to connect to the Oracle database. (For information on how to create ODBC DSNs to connect to Oracle databases, see the "References" section).
Type a User name and Password. Click the Test Connection button to make sure that you can connect to your Oracle database.
Once you have established a successful data connection in the Visual InterDev Web project, you can start to create ASP pages to call nonparameterized and parameterized stored procedures from your Oracle database server.
To Call a Nonparameterized Stored Procedure in Oracle
Add an ASP page to the Web project: right-click the project in the Project Explorer, click Add, and then select Active Server Page.
Add a Recordset DTC to the ASP page. To do so:
From the View menu, select Toolbox, and then select Design-Time Controls.
Drag a recordset DTC to a position following the <BODY> tag on your ASP page. A dialog box appears and asks if the Visual InterDev Scripting Object Model should be implemented.
Right-click the recordset DTC, and then select Properties. Select SQL Statement.
In the SQL Statement text box, type the following: