Try using just the Connect method with the ConnectionString set to the DSN name... that should do the trick. ConnectByDsn has been deprecated and doesn't handle all the connection setup options that Connect supports when the connection is established.
Basically there is:
SQLSetProp(0, 'DispWarnings', .F.)
that causes warnings to fail as errors rather than pop up dialogs. These settings (there are several of them) are global SQL settings on the envrionment.
+++ Rick ---
I am using the below in my app to query a SQL Server table. Sometimes while running the example below, a dialog will appear with my SQL Server UID and PW in the dialog waiting to someone to press 'Ok'. The app is hung until someone response to the dialog.
What causes the dialog to appear? Is there a way to trap for it? Whats the recommended way of handling this?
o = CREATEOBJECT([wwsql])
ll_isconnected = o.ConnectByDsn('Mydsn', 'myuid', 'mypw')
ln_sqlresult = o.Execute(tc_sql)
Thanks,
Jerry
| Rick Strahl West Wind Technologies Where do you want to surf today? | Reader Version: 5.0 |
from Maui, Hawaii