Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Use of ADO with MSDAORA provider

Use of ADO with MSDAORA provider

From: Gregory Volkonsky <gregoryvo_at_hotmail.com>
Date: Tue, 23 Oct 2001 10:40:01 +0200
Message-ID: <3bd52d1b$1@nntp.kla-tencor.com>


I have some problem with ADO using MSDAORA provider: The following is algorithm of the problem:

  1. Connect to Oracle with MSDAORA provider
  2. Select rows from any table into recordset
  3. Save recordset into file in XML format
  4. Open this file by another recordset.
  5. Open connection to the same DB
  6. Save data from file into DB back (previously this data was removed from DB)

The following is code:
To save into XML file:
Dim cn As New ADODB.Connection

Dim rst As New ADODB.Recordset

cn.Open "Provider=MSDAORA;Data Source=OMER1", "GREG", "GREG"

rst.Open "SELECT * FROM x", cn, adOpenDynamic, adLockOptimistic, adCmdText

'For sake of illustration, save the Recordset to a diskette in XML
'format.

rst.Save "c:\Stam\pubs.adtg", adPersistADTG MsgBox "Save into file is done!"
rst.Close
cn.Close

To take the data from XML file back to DB:

Dim cn As New ADODB.Connection
Dim rst As New ADODB.Recordset

'If there is no ActiveConnection, you can open with defaults.
rst.Open "c:\Stam\pubs.xml"

'Connect to the database, associate the Recordset with the connection,
'then update the database table with the changed Recordset.
cn.Open "Provider=MSDAORA;Data Source=OMER1", "GREG", "GREG" rst.ActiveConnection = cn

rst.Update // HERE THE PROGRAM FAILS

Please help Received on Tue Oct 23 2001 - 03:40:01 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US