I have a VB6 application which allows a user to enter the remote server name manually. I need to use the server name provided by the user to connect to a MySQL database.
How can I check whether the server that the user entered is valid and that I can connect to it?
The only reliable way to see if it is valid and that you can connect to it is to try and connect to it. Anything else will cause a potential race condition (it became invalid between the check and actual use) or have the possibility of incorrect results, as you wouldn't be checking what you actually want to do.