Adding records to Oracle using VB6 class

From: SomeoneKnows (SomeoneKnows_at_discussions.microsoft.com)
Date: 01/24/05


Date: Mon, 24 Jan 2005 09:31:59 -0800

I have a problem using VB6 and a Class Object generated by the Data Form
Wizard. I've created two sample programs, both using ODBC DSN connections and
a form/class generated using the Single Record form layout. One program's
ODBC connection points to an Access database and the other program uses and
ODBC connection to an Oracle database. Both databases have a table I've
called Vendor_Code. The Access table has a primary key with Autonumber
feature on the Vendor_ID and the Oracle table is defined as Not Null and
Unique for its Vendor_ID field with an Oracle Sequence created to supply a
next sequence value.

My sample program using the Access database works fine when adding a new
record but the other program connecting to Oracle fails trying to add a new
record with the message:
        Error '-2147467259(80004005)': "Method 'AddNew' of object '_Recordset'
failed.

I suspect the problem is when creating a new Oracle record, the Vendor_ID
field is not being populated with the next sequence number. VB6 seems to hide
the details of actually creating a new record and I don't know how to get the
next sequence value from Oracle then place that value into the recordset
before VB tries to insert the new record. The version of Oracle the company
is using is Oracle 9 with Oracle 8.1.7 client.

How do you get a VB6 class object to create a new record in Oracle which
includes an Oracle generated sequence number? How do I get the dataBinding
with VB6 classes to interact with Oracle databases?

Thanks,
Vince



Relevant Pages

  • RE: ADO.Net Connection Pooling Problem with Oracle
    ... the CLR is releasing the connection to your database. ... the number of database sessions in Oracle seem to ...
    (microsoft.public.dotnet.framework.adonet)
  • RE: SOS! ORA-03114: not connected to ORACLE && MSs Bug??
    ... not connected to ORACLE && MS's Bug?? ... > but sometimes returning the following exception "ORA-03114: ... > when loosing the connection with the Oracle database server the connections ... > even after the connection with the database server has been restore. ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: SOS! ORA-03114: not connected to ORACLE && MSs Bug??
    ... not connected to ORACLE && MS's Bug?? ... > but sometimes returning the following exception "ORA-03114: ... > when loosing the connection with the Oracle database server the connections ... > even after the connection with the database server has been restore. ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: SOS! ORA-03114: not connected to ORACLE && MSs Bug??
    ... not connected to ORACLE && MS's Bug?? ... > but sometimes returning the following exception "ORA-03114: ... > when loosing the connection with the Oracle database server the connections ... > even after the connection with the database server has been restore. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Connecting to ODBC DB at startup
    ... Creating an Oracle connection in an independent object ... Dim cnConn As ADODB.Connection ... Dim strDB As String ...
    (comp.databases.ms-access)