How can SilkTest check the status of a database connection during testing.
There isn"t a specific function to check the status of a db connection but there is a simple way of checking the status, which you can incorporate into a function of your own.
The line suggested is : Print(hdbc) where hdbc is the handle to the database.
If this line is called and there is a connection then it will just print out the value of hdbc,
[-] Testcase sqlconnect - Passed [ ] H1048576
If however there is no connection when this line is called then we will get an error, eg:
[-] Testcase sqlconnect - 1 error [ ] *** Error: Variable has not been set [ ] Occurred in sqlconnect at testsqlconnect.t(8)
Therefore, the idea would be to write a function with this in mind, if you put the
Print(hdbc) in a Do...Except and when its called, an exception is raised then you
can send yourself that email or notice telling you that the connection status at the
moment is that there is no connection, otherwise say that connection is intact.