General information
Category:
Coding, syntax & commands
Drawings(table) table is open with 3 as well as Enterdrawpart(view)
When I save with the code below a new record the indexes are not updated but if it is an existing record it is updated.
AS soon as I remove the Transactions command everything is OK.
updsuccess = .F.
DIMENSION atablesused[2,1]
DIMENSION aerrors[1]
atablesused[2,1]= "Drawings"
atablesused[1,1]= "Enterdrawpart"
*BEGIN TRANSACTION
FOR i = 1 TO 2
SELECT (atablesused[i,1])
* BEGIN TRANSACTION
updsuccess = TABLEUPDATE(.t.,.f.)
IF updsuccess
* END TRANSACTION
LOOP
ELSE
* ROLLBACK
ENDIF
some error handling
ntoterr=AERROR(aerrors)
DO CASE
CASE aerrors[1,1] = 1539
blabla
ENDCASE
EXIT && No point trying the next one
ENDFOR
IF updsuccess
* END TRANSACTION
ELSE
* ROLLBACK
ENDIF
RETURN updsuccess
>I hope I understand. You don't need to open your table if your view is drawn from the table and is handling updating the table. And you then only need to TABLEUPDATE the view. Is your form using private datasessions? Is your view a simple view on one table?
>>I am using a form with 1 table (optimistic row buff) and a local updatable view (optimistic table buff).
>
>Again, if you add a record to the table that contributes to the view, then you need to requery the view. Indeed, you may want to set the DE cursor propert NoDataOnLoad to True for the view. But, again, you might not need to be opening both.
>I call the form and insert a record in my table in the init event of the form.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only