Following on from this...
Basically, I have a form from which the user selects the ODBC connection they want to use, including a username and password if required.
Before they move on, I want to check this connection is OK (basically by connecting to it). If they have not entered the username and password correctly, I don't want the ODBC dialogue appearing requesting the correct info, I just want it to error out so I can throw a message saying there's an issue.
From what I can tell you can only turn off the dialogue using SQLSETPROP only when you have successfully made the connection!
If you have Windows authentication set in the ODBC connection, it doesn't matter if you specify username and password in the SQLCONNECT() statement as it is simply ignored, and I only want to show the username/password fields if they are required by the connection.
is any of this possible?
I like work. It fascinates me. I can sit and look at it for hours...