dbTalk Databases Forums  

Recordset Update

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Recordset Update in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Daniela Menneweger
 
Posts: n/a

Default Recordset Update - 11-20-2003 , 03:42 AM






Hallo NG,

I generated an ActiveX-Script Task. The Problem, I can't update the
recordset anymore. Following error occurs: "Identity cannot be determinded
for newly inserted rows".

--------------------------------------------------------------------
Setting connection...
Opening recordsets.......

Looping through recordset....

bKommen = True

Select Case rs("BUCHUNG_CODE")

Case "KO", "GE"
If bKommen Then
bKommen = False
rsTDaten.AddNew
rsTDaten("BUCHUNG_BIS") = "XX:XX"
rsTDaten.Update

Else
bKommen = True
'The error occurs here......
rsTDaten("BUCHUNG_BIS") = rs("BUCHUNG_UHRZEIT")
rsTDaten.Update

End If

Case "....."

Case "...."

End select

----------------------------------------------------------------------

Hope you can help me. Thanks in advance.

Daniela



Reply With Quote
  #2  
Old   
Billy Yao [MSFT]
 
Posts: n/a

Default RE: Recordset Update - 11-21-2003 , 12:58 AM






Hi Daniela,

Thank you for using MSDN Newsgroup! It's my pleasure to assist you with your issue.

From your description, I understand that when the newly inserted rows are inserted and
updated, the error message pops up and in a result no rows are inserted into your table. Have
I fully understood you? If there is anything I misunderstood, please feel free to let me know.

Looking through your simplified code, I find no suspicious culprits that will prevent this newly
inserted rows from gracefully updating. However, I'm unsure of the "rs
("BUCHUNG_UHRZEIT")". Also I have few iedas of the target table in which your rows
inserted as well. It's maybe not related to the issue but please ensure that the operations of
inserting and updating are correct and there are no switches that will have an impact on the
insertions.

Based on my experience, if the rows get inserted, you have get ID (IDENTITY col values)
associated with this new row and generate a GUID and update SerialNumber column with this
newly generated GUID.

If you have a SQL Server table with a BEFORE-INSERT trigger (INSTEAD OF INSERT
Trigger) which controls the insertion operations, the symptom may occur and it allows no insert
operations. So please also make sure if there is any INSERT triggers on your target table.

Additionally, as we know, the DBPROP_CHANGEINSERTEDROWS property should be set
when you open a Keyset cursor and want to update a row that's been inserted newly. In this
scenario, I recommend you update the rows directly without any positioning.


Daniela, does this answer your question? If there is anything more I can do to assist you,
please feel free to post it in the group


Best regards,

Billy Yao
Microsoft Online Support
----------------------------------------------------
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only. Thanks.



Reply With Quote
  #3  
Old   
Billy Yao [MSFT]
 
Posts: n/a

Default RE: Recordset Update - 11-26-2003 , 03:20 AM



Hi Daniela,

How is this issue going on your side currently?

If you still cannot update the recordset, could you please narrow down the problem by running
a corresponding T-SQL Insert statement to see if there is some related constraints (PK,
Default, Cascade...) or Insert Trigger on the underlying table.

Additionally, the issue may also related to how you create the connection (Cursor locatoin,
LockType ...) . So if you can use T-SQL statement in Query Analyzer to insert the row, the
problem is narrowed down to the Task coding.

All our efforts will make things clear and move closer to the causes and resolutions. If there is
anything more I can do to assist you, please feel free to post it in the group.

Best,

Billy Yao
Microsoft Online Support
----------------------------------------------------
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only. Thanks.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.