You can hide window dialog box.
Try this.
LOCAL lnH
LOCAL ARRAY laErr[1]
lnH = 0
SQLSETPROP(lnH,'DispLogin',3)
lnH = SQLCONNECT("universe","username","password")
IF lnH < 0
AERROR(laErr)
MESSAGEBOX(laErr[3],16,"Database connection fails")
ELSE
MESSAGEBOX("Database connection Ok",64,"Ok")
ENDIF
>Stev,
>I forgot to mention that the erro messagebox is from a SQL server message indicating "connection failed" SQL Server error 4060.
>The messagebox appears before the error handler in the vfp program is even aware that an error has occurred.
>I was wondering if there may be an API that would indicate the messagebox was there.
>
>When the mb appears it requires the user to click OK button [keyboard {enter}] and then the sql login window pops up requesting user interface OK or Cancel.
>
>I need to programmatically determine when the window is there.
>
>Any ideas?