inserting guid does not work when DBPROP_SERVERDATAONINSERT is set

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Rudolf Wiener (nojunk.rudolf_at_wiener.at)
Date: 03/22/04

  • Next message: moh gh: "help: OLEDB and Importing Text-Files"
    Date: Mon, 22 Mar 2004 21:56:00 +0100
    
    

    I am using VC++ with OLEDB for MSSQL2000 and Oracle 9.2 (OraOLEDB)

    I'd like to insert a GUID value into a (new) record. I try to achieve this
    with a command object and with accessors, just like with so many other
    columns and tables. While I succeed with retrieving the values I fail
    during insert.

    This is the table (in MSSQL):
            create table tTestGUID ( GUID_GUID uniqeidentifier );

    The accessor maps this single column to the following data member:
            GUID m_guid;

    Here's the select-stmt used as a command:
            select GUID_GUID from tTestGUID;

    I also set the properties for inserting data:
            CDBPropSet propsInsRow (DBPROPSET_ROWSET);
            propsInsRow.AddProperty (DBPROP_IRowsetChange, true);
            propsInsRow.AddProperty (DBPROP_SERVERDATAONINSERT, true);
            propsInsRow.AddProperty (DBPROP_APPENDONLY, true);
            propsInsRow.AddProperty (DBPROP_UPDATABILITY, DBPROPVAL_UP_INSERT);

    and finally I open the command object:
            CCommand <CAccessor <CAcc_Test02> > cmdI;
            hr = cmdI.Open (m_session, csSelect, &propsInsRow);

    In MSSQL this fails with the HRESULT 'Multiple step operation generated
    errrors...'
    As soon as I take out the DBPROP_SERVERDATAONINSERT property, the insert
    works in MSSQL.

    With Oracle the Open() works always, but the actual insert-statement fails
    always.
            hr = cmdI.Insert (0,true);

    Does anybody have any hints for me?

    Thanks, Regards
    Rudi Wiener

    -- 
    Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
    

  • Next message: moh gh: "help: OLEDB and Importing Text-Files"

    Relevant Pages

    • Re: Intermittent problem in data transfer MSAccess to Oracle using VB
      ... the row it fails on has always had a numeric value in the Hours column. ... It retrieves data from a MSAccess database and writes to an Oracle database. ... Dim MSAccessConn As String ... In other words, it has always written to the log file, connected to the Access database, returned a recordset, connected to the Oracle database and deleted all rows from DATABASE1.TABLE1 with no failures. ...
      (microsoft.public.vb.general.discussion)
    • Re: Oracle transactions and DDL statements.
      ... DA Morgan skrev: ... architecture of products, such as Oracle, on which you might implement ... midway (or the power fails), the poor programmers will now have to ... Daniel A. Morgan ...
      (comp.databases.oracle.misc)
    • Re: [ANN] AnyDAC 1.0.2 - Freeware Oracle, MySQL, MSSQL, etc data access framework
      ... And also interesting, if you will buy Oracle, MSSQL, MySQL ... And technical support will be cost just 1/2 ... ...
      (borland.public.delphi.thirdpartytools.general)
    • Re: SSIS Import Job
      ... it sure sounds like an Oracle issue. ... manually, and yet it fails when schedulsed, can you give us more details as ...  The job imports ...  The job runs via job scheduler, ...
      (microsoft.public.sqlserver.dts)
    • cannot reuse command objects under oracle oledb (on one system).
      ... behavior with the Oracle OLEDB Provider? ... The error occurs on the command object Execute method. ... 31100 If (nDataOptions And opdataMenu) Then ... 31400 If (nDataOptions And opdataPhysicalURL) Then ...
      (microsoft.public.inetserver.asp.db)