>>>>Hi,
>>>>
>>>>I use CursorAdapters for inserting/updating/delete data in SQL Server. I have a base class that all tables use. The problem is when I try to delete a record in one of the tables it does not work. I get no error and when I step through the code in debugger everything seem to be normal. But the record in SQL Server never gets deleted. I have checked the code in the CursorAdapter class, method BeforeDelete and it correctly has expression:
>>>>
>>>>delete from TableName where Pk_Fld = ?oldval('Pk_fld','CaViewName')
>>>>
>>>>
>>>>I also checked in the same method that the value of oldVal('pk_fld') is the one I am trying to delete.
>>>>
>>>>When I delete a record from another table (using the same base class), it works.
>>>>
>>>>Where should I look for? In SQL Server? or in my VFP code? TIA.
>>>
>>>
>>>Run SQL Profiler and see what happens at the SQL Server end.
>>
>>Could the line, right before the call to EXEC SP_EXECUTESQL is called, be causing the problem. The line is:
>>
>>
>>set implicit_transaction on
>>
>
>Nope, but as Naomi suggested already copy this code in SSMS and run it.
>Then see what message you will get.
>I saw that you don't have triggers, but did you have FK constraints?
As I mentioned to Naomi, executing this line in SSMS works; no error. Yet the record is not gone.
I do have FK constraints but there would be an error if the FK would stop the delete, right?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham