>>I'm testing for SQL Server connectivity from a VFP app. My first attempt is to set a connection string, then try to get a handle to the SQL Server instance using SQLSTRINGCONNECT( ).
>>
>>My initial testing is with the SQL Native Client 11.0.
>>
>>This works great if the parameters are correct. However, what I actually want to do with this code is handle the case where the parameters are wrong (or there's a network problem etc.)
>>
>>If there's something wrong the client driver first puts up a helpful error dialog (see image SQLDialog1.png). Then it puts up a dialog offering the user the chance to manually make parameter changes and try again (see image SQLDialog2.png). Only after the user manually cancels out of both dialogs does the SQLSTRINGCONNECT( ) call finish and return -1.
>>
>>Does anyone know how to suppress these dialogs? This program has to run unattended.
>>
>>In a perfect world, it would be great to somehow get the contents of the first dialog (which is actually quite helpful) so I can subsequently log it.
>
>
>sqlsetprop(0, 'DispLogin', 3)
>sqlsetprop(0, 'DispWarnings', .f.)
>
Exactly. I remember these settings but had to search for them.
If it's not broken, fix it until it is.
My Blog