How do I create a script which retries to connect to SQL?Hi,
The database which I am using is very unstable, so it fails a lot mid-way when tries to connect to SQL. How do I script it so that when it fails, it retries unitil it connects or until a maximum of five times.
Thanks.
Data AccessRe: How do I create a script which retries to connect to SQL?You might be able to use the LogCapture() function which allows you capture messages sent back to the JMP log by function calls.
Something like this :
RetryCount = 0
ErrMsg = LogCapture(<YOUR sql="" connection="" string="">);
while( contains(ErrMsg, <SOME error="" string="" you="">) & RetryCount < 5,
++RetryCount;
ErrMsg = LogCapture(<YOUR sql="" connection="" string="">);
)</YOUR></SOME></YOUR>