Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VERIFY ODBC CONNECTION

Status
Not open for further replies.

99Chuck99

Programmer
Dec 11, 2003
67
US
Hi All,
I have a question, I have set up a ODBC connection using the ODBC administrator in MSACCESS to link to an Oracle database on a network server, which works great. Prompts user for ID & PASSWORD. Is there a way to test this connection prior to any code running in case they enter an invalid password. Thanks in advance for any help.
 



Sure, if you handle the prompts and then insert the ID & Password into the Connect String and open the database and test the connection.

Skip,

[glasses] [red][/red]
[tongue]
 
Each user on this shared database has been set up with an ODBC connection through the MSACCESS ODBC administrator (CONNECTION NAME = MAXPROD) which prompts the user for ID and password. I do not have a connection string in my code. If I set one up would the verfiy the MAXPROD connection?
 
I'm thinking something like this...
Dim cn as Adodb.connection
Dim str as string

Set cn = new adodb.connection
cn.connectionstring = "DSN=MAXPROD"

cn.open
(test connection prior to code runing with promt if logon invalid)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top