Ado child updating

Can't I perform this with a disconnected recordset? Thank a lot Gunther Desmedt Belgium -- PRB: Unable to Delete from Table Having Cascade Delete Trigger Last reviewed: November 9, 1998 Article ID: Q194981 The information in this article applies to: Active X Data Objects (ADO), version 2.0 SYMPTOMS Deleting a record from a SQL Server table with a cascade delete trigger causes the following error message when there are no matching rows in the child table if the OLE DB provider is used for SQL Server: -2147217864 The specified row could not be located for updating: Some values may have been changed since it was last read. Tip Two: Before giving less than an 'A' grade, tell the Experts that the solution is less than excellent and what grade you are prepared to assign. as YOU rather have others do YOUR work for YOU only to stiff them for the points! When I look with the SQL Profiler nothing is sent to SQL server. Thank you very much for your responsiveness, it is very much appreciated. If you don't reply within the next 3 days, I will force accept wsh2's comment.

CAUSE The only way the Client Cursor Engine has to determine whether the update succeeded is by interpretation of the return code from the provider's ICommand:: Execute. Close End Sub Run the application, click Command1 and you get the error. Give them the chance to improve their response for a better grade. So I guess the error doesn't come from the database but from ADO itself. DAT): Q270636 - PRB: Passing a Recordset to a DLL to Do an Update Batch More Than Once Causes Error

Ernest "ja YPee" does anyone experienced slowness when updating a dataset using Accept Changes? however i have this scenario that if i don't use Accept Changes the record in the datagrid (which contains related table) is not showing this is the scenario: i have a parent/child form that after clicking a checkbox in the parent form the program will execute the stored procedure from sql server 2000 then save the data in the related table that is based on the criteria from the primary table and filling the datagrid (which contains related table) but i can't see the changes after clicking the checkbox if i don't use Accept Changes after an update. On Fri, 0200, "Ernest Morariu" From MSDN: When using Update, the order of execution is as follows:1. If the command is set to First Returned Record, then the first returnedresult is placed in the Data Row.6. So don't need to call explicitly Accept Changes because the Update methodalready does this.

So don't need to call explicitly Accept Changes because the Update method already does this.

If you and the Experts cannot resolve the question then you can click on the Delete Question link (if visible) or post a zero point question in Community Support and ask for it to be deleted (link at the bottom of every page). If you've been helped by the participating expert(s), you may just convert their comment to the accepted answer and then grade and close.

If the execution returns a failure code, the update is presumed to have failed. Re-create the trigger with "SET NOCOUNT ON" to avoid the error. Tip Three: Always post a comment when accepting a grade. Wsh2, I hope this information can help you along :-) ).. ASP Q193515 - PRB: Update of Same Record 2x w/Disconnect ADO Recordset Fails

In the preceding case, the trigger is disguising the results of the original operation. To do this, execute the following SQL script in ISQL/W one line at a time: Use Pubs drop trigger Table A_trigger1 go Create trigger Table A_trigger1 On Table A for delete As Set NOCOUNT ON delete Table B from Table B, deleted where Table = guntherds Question History: Questions Asked: 7 Questions Answered: 5 Last 2 Grade(s) Given: A B Last 5 Grade(s) Received: A A A C B Question Grading Record: 2 / 3 One Abandoned Question.. And what about the Question you left that quote in? Update the Experts and let them know that the solution worked and why it worked. Experts Exchange is a completely free site for you. or how to comport oneself in a professional manner.. take a quick look at these 2 MSDN Problem Reports.. you stated in your question that this a byproduct of a Shape command? and is the data in the recordset being presented in its proper hierarchial order?

Add a single row to Table A and Table B is left empty to reproduce the problem. From the Project menu, choose References, and select the Microsoft Active X data objects 2.0 Library. Open "select * from table A", cnn, _ ad Open Static,ad Lock Batch Optimistic rst. Delete ad Affect Current 'Delete the Row from the Parent Table cnn. This keeps the Experts informed of your progress and the current state of the problem.

Create a delete trigger on Table A that deletes all matching rows from Table B in order to maintain referential integrity. Paste the following code in the Code window: Option Explicit Private Sub Command1_Click() Dim cnn As New ADODB. Recordset Dim str Cnn ODBC As String Dim str Cnn OLEDB As String On Error goto err_trans str Cnn OLEDB = "Provider=SQLOLEDB.1; User ID=sa;" & _ "Initial Catalog=Pubs; Data Source=sujoy" cnn. You will never regret keeping the Experts informed on the status of your problem that they are trying to fix. If you will follow those five tips and the advice I have given you about managing your questions, you will get the most out of Experts Exchange - The Best Site On The Internet! so who wants to rewrite the whole MSDN article above for guntherds so that guntherds doesn't know who the deserved author is?

Leave a Reply