>Often times, after the above code, the program fails when attempting to SQL Select some records from the SQL Server.
>
>So, I am thinking that the code of testing SQLEXEC() against an empty string, should be changed to testing SQLEXEC() against something in the SQL Server. Because, if the connection to the SQL Server is broken, the SQLEXEC() can still successfully work on an empty string. Right?
>
>If the above logic is correct, how do I change the test of SQLEXEC() NOT against an empty string but against something in the SQL Server?
Without going into the issue what does an empty command do, how about just „select @@version“?