>Erik
>I am Creating my index's on the click method of the header. I wrap the index
>creation with setting the buffer mode to 3 and then back to 5 after the index has been set. The problem is that when I do my BEGIN TRANSACTION I am getting an error.#1548 "Table v_orders has one or more non-structural index's open. Please close them and retry the Begin Transaction."
>Here is my code:
> CURSORSETPROP("Buffering", 3, "v_orders")
> IF FILE(SYS(2003)+"\inorder.idx")
> SET INDEX TO
> **get rid of old index
> ERASE inorder.idx
> ENDIF
> **now index on this header.
> SELECT "v_orders"
> INDEX ON status TO inorder
> SET ORDER TO inorder
> **refresh and put it back.
> THISFORM.refresh
> CURSORSETPROP("Buffering", 5, "v_orders")
>
>The begin transaction code is in my defined save event:
> BEGIN TRANSACTION
> m.lSuccess = TableUpdate(.F.,.T.)
> END TRANSACTION
>
>I guess I could see if there are any open indexes before the Begin Transaction, but that means I have to do that for every Begin Transaction in every form. (maybe not as big a deal as I am dreading though -- it is in the base class.)It just seems a little messy to me.
>Jill
Ahhh, I remember this one.
A couple of things:
1. Is there a reason you specifying a specific index file? In my experience, if you just issue INDEX ON, you will not get the transaction error.
2. Unless there is more than one TABLEUPDATE() statement between your BEGIN and END statements, the transaction is gaining you nothing. Either a tableupdate succeeds or it doesn't. Transactions give you the ability to ROLLBACK changes that have already been committed within the transaction. If all you need is to be able to clear the buffer, you should just use TABLEREVERT().
Erik Moore
Clientelligence