Re: ADO Recordset second Update fails
From: Mark J. McGinty (mmcginty_at_spamfromyou.com)
Date: 02/06/05
- Next message: Brendan Reynolds: "Re: ADO Recordset second Update fails"
- Previous message: William \(Bill\) Vaughn: "Re: MSDE 2000 and datset and ado"
- In reply to: desavera: "ADO Recordset second Update fails"
- Next in thread: desavera: "Re: ADO Recordset second Update fails"
- Reply: desavera: "Re: ADO Recordset second Update fails"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 6 Feb 2005 04:31:21 -0800
"desavera" <desavera@discussions.microsoft.com> wrote in message
news:CB505984-4ED9-429D-BC96-EE594E5B0A90@microsoft.com...
> Hi Folks, first time in MSDN....
>
> could someone please help me with the issue of having a two steps Update
> call
> on a ADO.Recordset object problem ?
>
> the error message is :
>
> Identity(1,1) cannot be determined for newly inserted row.
>
> the description of the context is that I am using an autonumber column to
> determine the value for another column. The autonumber returns Ok from the
> first Update (doing GetCollect) but when I use GetItem in order to *set*
> the
> new value (retreived from the autonumber) for the other column it fails :
>
> Recordset.addNew()
> Recordset.getItem() // several GetItem() calls
>
> Recordset.Update()
>
> tmpValue = Recordset.GetCollect()
> Recordset.GetItem(colname) = tmpValue // ERROR !!!
> Recordset.Update()
>
> any tip would be appreciated. The funny thing is that I am trying to do
> this
> using SQLServer provider but when I use MS-Access provider it works just
> fine !!!
>
> Mario.
Try setting this dynamic property after you create, but before you open the
Recordset object:
rs.Properties("Change Inserted Rows") = True
That tells the provider that you want to be able to update records that have
been inserted using this recordset, without requerying first.
-Mark
- Next message: Brendan Reynolds: "Re: ADO Recordset second Update fails"
- Previous message: William \(Bill\) Vaughn: "Re: MSDE 2000 and datset and ado"
- In reply to: desavera: "ADO Recordset second Update fails"
- Next in thread: desavera: "Re: ADO Recordset second Update fails"
- Reply: desavera: "Re: ADO Recordset second Update fails"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|