Excel VBA to Oracle - OO4O

From: mrpaulwass <mrpaulwass_at_hotmail.com>
Date: Sun, 21 Jul 2002 15:26:41 GMT
Message-ID: <RoA_8.206699$Bt1.11109296_at_bin5.nnrp.aus1.giganews.com>


Are there any boards for people writing excel VBA scripts to move data back and forth between excel and Oracle?

And if not, can anyone tell me how to disconnect a session and restart a new one? In the example below, a session is created, a database connect started, and a dynaset created.

Now I want to connect to a new database. How do I disconnect from the first one? I tried unload, removefrompool, and some others, but had no luck. Anyone know?

Thanks,

Paul

Sub Form_Load ()
'Declare variables

  Dim OraSession As OraSession
  Dim OraDatabase As OraDatabase
  Dim OraDynaset As OraDynaset

'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&)

'Create the OraDynaset Object.

  Set OraDynaset = OraDatabase.CreateDynaset("select empno, ename from emp", 0&)

'Display the first record.

  txtEmpNo = OraDynaset.Fields("empno").value   txtEName = OraDynaset.Fields("ename").value

End Sub Received on Sun Jul 21 2002 - 17:26:41 CEST

Original text of this message