inserting guid does not work when DBPROP_SERVERDATAONINSERT is set
From: Rudolf Wiener (nojunk.rudolf_at_wiener.at)
Date: 03/22/04
- Previous message: David Schleifer [MSFT]: "Re: DataLinks dialog with provider already selected..."
- Next in thread: Roger: "Re: inserting guid does not work when DBPROP_SERVERDATAONINSERT is set"
- Reply: Roger: "Re: inserting guid does not work when DBPROP_SERVERDATAONINSERT is set"
- Messages sorted by: [ date ] [ thread ]
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/
- Previous message: David Schleifer [MSFT]: "Re: DataLinks dialog with provider already selected..."
- Next in thread: Roger: "Re: inserting guid does not work when DBPROP_SERVERDATAONINSERT is set"
- Reply: Roger: "Re: inserting guid does not work when DBPROP_SERVERDATAONINSERT is set"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|