Unanswered: How can I avoid to display the default database connection screen using DAO?
I'm programing my own login screen for my database application (VB6), when the program starts, this login screen appears and retrieves the information about user name and password to connect to the database, but, if this information is wrong, before my error handler show any exception, the default database connection screen appears and let the user retry to connect to the database, that's the screen that I need to avoid show to the user. Somebody can help me?
Here is the code (part):
On Error Goto Error_Handler
Set Cnt = DBEngine.OpenDatabase("pubs", dbDriverNoPrompt, False, "ODBC;DSN=pubs;UID=" + sUser + ";PWD=" + sPwd) 'If this call fails, the program shows the default login screen and let the user retry
I have created my own login boxes, albeit to Oracle databases. However I used data environments (picked up someone elses project). But in there I had to set the connection RunPromptBehaviour to adPromptNever.
Therefore you might be able to access the attribute for a code-defined connection and set the prompt.
Once it was set to false, I was able to use my box primarily