Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need good practice suggestion
Message
From
23/10/2008 09:01:58
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01356528
Message ID:
01356539
Views:
34
>>>Good morning,
>>>
>>>I have a function in my application that is used in many, many places. The function receives a SQL Select expression and executes it using a Macro substitution. Once in a while I get an error from customers where the execution of SQL Select fails. I am thinking that I should wrap this macro substitution call in TRY/CATCH. My concern is that I think I read something here that TRY/CATCH slows down the execution. If so, is it still (in your opinion) worth a slight delay in execution to have TRY/CATCH around such a frequently used function?
>>>
>>>Thank you in advance for any suggestions.
>>
>>Generally speaking every line of the code should be error-handled, i.e. some custom error message should be raised anyway; therefore your concern is not critical.
>>By the way, what kind of specific error happens in your Select-SQL?
>
>So far what I have seen a couple of times the error being "File is in use by another user".
>
>Thank you for your input.

This error may indicate that you have SET EXCLUSIVE ON and Select tries to use some table, not open yet in the code. I would fix this problem, i.e. eliminate the error. TRY/CATCH is supposed to be used when error is more elusive, e.g. some network drive may exist or not, some import file is supposed to have specific format, etc.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform