If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > How can I avoid to display the default database connection screen using DAO?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-17-03, 18:03
AlexGM AlexGM is offline
Registered User
 
Join Date: Feb 2003
Location: México
Posts: 2
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
.
.
.
Exit Sub
Error_Handler:
MsgBox "<Error>"
Resume Next
Reply With Quote
  #2 (permalink)  
Old 02-17-03, 18:18
Ad Dieleman Ad Dieleman is offline
Registered User
 
Join Date: Jan 2003
Location: Dordrecht, The Netherlands
Posts: 95
I have solved this problem in Access VBA by first creating a ODBCDirect Workspace wspODBC and then call the OpenConnection method:

Dim wspODBC As Workspace, conODBC As Connection
Dim strConnect As String

strConnect="...." 'You obviously know what to put in there

Set wspODBC = DBEngine.CreateWorkspace("ORCL","Admin","",dbUseOD BC)

Set conODBC = wspODBC.OpenConnection("ORCL", dbDriverNoPrompt, False, strConnect)

etc.
Reply With Quote
  #3 (permalink)  
Old 02-18-03, 14:16
kaukinend kaukinend is offline
Registered User
 
Join Date: Feb 2003
Posts: 4
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

Good Luck,
Daniel
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On