Reputation: 53
I need to add a row to a fox pro table and before inserting the row I need to disable the trigger applied on the fox pro table and enable it back after inserting the row.
Is there any way to disable fox pro trigger from c# .NET ?
Thank you for any hints regarding this.
Upvotes: 0
Views: 126
Reputation: 23797
Unfortunately, there is no direct way of doing that, even using ExecScript. Using ExecScript, you could run delete trigger
code and it would return true
without any errors as if it did it. But it doesn't remove the trigger, nor returns information that the trigger is still intact. Unfortunately, you can't even use ExecScript to bypass code that is otherwise not supported by the VFPOLEDB.
The only way you can do it, is to create a copy of the dbc (using VFP modify database
- or C# low level if you are brave enough) and in that copy have the the same table definition without the trigger.
For example:
Take a copy of your existing .dbc (.dct and .dcx)
Modify table to remove the trigger (or do it in code:)
Delete Trigger On ('yourTableName') For Insert
It is cumbersome but better than nothing.
Probably you would want to instead have an VFP executable that you can call with parameters and that does the insertion for you.
Upvotes: 1