
- #Vb6 missing microsoft dts package object library how to#
- #Vb6 missing microsoft dts package object library code#
Set the Data properties to access the data field and source that you want. When Oracle Data Control is set up, you can drag and drop a Visual Basic control onto the same form and access the data in the control. Set up the Connect, DatabaseName, and RecordSource properties as follows to access the Oracle database:ĭescription of the illustration dcprops.gif Resize and position the control.Ĭhange the name of the control to OraDataControl. To add Oracle Data Control to a project, drag and drop the control onto a form. The Oracle Data Control is added to your Visual Basic tool palette and looks like this:ĭescription of the illustration oradc.gif In the Components option of the Project menu, add Oracle Data Control to the project.ĭescription of the illustration o4o00004.gif Start Visual Basic and create a new project. Setting Oracle Data Control Properties with the Properties Window In the following screenshot, ClearData() is assigned to the Clear button and EmpData() is assigned to the Refresh button.ĭescription of the illustration exsheet.gif When you select the buttons, you can clear and refresh the data in the worksheet. Set flds(Colnum) = EmpDynaset.Fields(Colnum)įor Colnum = 0 To - 1ĪctiveSheet.Cells(1, Colnum + 1) = flds(Colnum).Nameįor Rownum = 2 To EmpDynaset.RecordCount + 1ĪctiveSheet.Cells(Rownum, Colnum + 1) = flds(Colnum).ValueĪssign the procedures (macros) that were created, such as EmpData() and ClearData(), to command buttons in the worksheet for easy access. 'This will reduce objects references and speed up your application. 'Declare and create an object for each column. Set EmpDynaset = OraDatabase.CreateDynaset("select * from emp", 0&) Set OraDatabase = OraSession.OpenDatabase("ExampleDB", "scott/tiger", 0&)
#Vb6 missing microsoft dts package object library code#
Use the Macro options in the Tools menu to create and edit new macros for manipulating the Oracle data.ĭescription of the illustration exmacros.gifĮnter Visual Basic code for macros to create and access an Oracle dynaset, such as the following EmpData() and ClearData() procedures (macros): To use OLE Automation with Microsoft Excel to insert Oracle data into a worksheet, perform the following steps: The sample code for this example is available in the ORACLE_BASE\ORACLE_HOME \oo4o\excel\samples\ directory. Do not include a semicolon ( ) at the end of the query.ĭescription of the illustration iissamp.gif Load the page in a web browser and click the link to the demonstration.Įnter a query, such as 'SELECT * FROM EMP', in the SQL SELECT Query field, and select the Submit Query button. OO4ODEMO.ASP">This link launches the demo! asa files in that directory.Ĭreate an HTML page from which to launch the oo4odemo.asp file. Ĭreate a virtual directory from Microsoft Internet Service Manager with read and execute access, and place all.

The database connection used in this script is obtained from a pool that is created when the global.asa is executed. This sample executes a SQL SELECT query and returns the result as an HTML table. Sub Application_OnStart 'Get an instance of the Connection Pooling object and 'create a pool of OraDatabase OraSession.CreateDatabasePool 1, 40, 200," exampledb", " scott/tiger", 0 End Sub Open p_cursor1 for select * from emp where deptno = indeptno Ĭreate the Active Server Pages (ASP) sample code. PROCEDURE GetCursor(p_cursor1 in out empCur, indeptno IN NUMBER,Ĭreate or replace the ASP_demo package body as follows: creates PL/SQL package to be used in ASP demos

Start SQL*Plus and log in to the Oracle database as scott/ tiger. The sample code for this example is available in the ORACLE_BASE\ORACLE_HOME \oo4o\iis\samples\asp\connpool directory. ' You can now display or manipulate the data in the dynaset. Set OraDynaset = OraDatabase.CreateDynaset("select * from emp", 0&) Set OraDatabase = OraSession.OpenDatabase("ExampleDb", "scott/tiger", 0&) ' Create the OraDatabase Object by opening a connection to Oracle. Set OraSession = CreateObject("OracleInProcServer.XOraSession") ' name by which the OraSession object is known to the OLE system. Then, add the following code to the Declarations section of a form:Īdd the following code to the load procedure associated with the form to display the Oracle data:

From the Project menu, select References and check InProcServer 5.0 Type Library.ĭescription of the illustration o4o00003.gif
#Vb6 missing microsoft dts package object library how to#
This example contains code fragments that demonstrate how to create all objects required by a dynaset and then create the dynaset itself.

Using Oracle Objects for OLE Automation with Visual Basic
