Oracle® Objects for OLE Developer's Guide 10g Release 1 (10.1) Part Number B10118-01 |
|
The following example inserts the new "PERSON" referenceable object in the server. Before running the sample code, make sure that you have the necessary datatypes and tables in the database. See Schema Description used in examples of OraObject/OraRef.
Dim OraSession as OraSession
Dim OraDatabase as OraDatabase
Dim Person as OraRef
'Create the OraSession Object.
Set OraSession = CreateObject("OracleInProcServer.XOraSession")
'Create the OraDatabase Object by opening a connection to Oracle.
Set OraDatabase = OraSession.OpenDatabase("ExampleDb", "scott/tiger", 0&)
'CreteOraObject creates a new referenceable object in the PERSON_TAB object table and returns associated OraRef
set Person = OraDatabase.CreateOraObject("PERSON","PERSON_TAB")
'modify the attributes of Person
Person.Name = "Eric"
Person.Age = 35
'Update method inserts modified referenceable object in the PERSON_TAB.
Person.Update