>>>>Hi,
>>>>
>>>>Would it be correct to assume that when SQL Select from VFP against SQL Server fails and the error is
>>>>
>>>>
>>>>Communication link failure
>>>>
>>>>
>>>>that the problem was that the SQL Connection timed out by the time user executed the SQL Select? Or if not, what else would be causing this type of error?
>>>>
>>>>TIA
>>>
>>>No, when the timeout is occurred then the error will be:
>>>"Timeout occurred", something like this.
>>>
>>>Communication link failure usually means that you do not have connection with SQL Server anymore.
>>>Some LAN troubles or if the SQL Server is on WAN maybe Internet connection is lost?
>>
>>A follow up question, please. Do you think if - on determining that this is the error message - I add a code to try to establish the connection to the SQL Server again?
>
>Usually before we issue any SQL command we try something that SHOULD return result.
>(That is very well stolen from Andy Kramek and Marcia Akins)
>
>IF SQLEXEC(handler goes here, "SELECT @@IDENTITY","crsTest") < 0
> ** What? we have no connection
> ** do what ever you wish. Quit the Application
> ** try to re-establish connection
>ENDIF
>
I have some places in my program where I do almost exactly the same; checking the connection. I was just concerned that if I do it as you, BEFORE ANY SQL command, I will slow down the application. But knowing that you are an expert in SQL Server and probably tested the effect of this approach on speed of the program. So I will follow your example.
Thank you!
"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