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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Defaulting ODBC User ID/Password 1

Status
Not open for further replies.

demedic

Programmer
Mar 12, 2002
3
0
0
US
I use a form that contains a style number field. When the user enters a style number a style description field is automatically poplulated. The style description is obtained from a linked table that is actually a mainframe DB2 table. The first time a user gets a style description Access prompts him for a username and password. Is there a way to have the username and password automatically entered behind the scenes so the automatic prompt never happens?
 
For once the Microsoft Knowledgebase paid off! After browsing several pages and getting the gist of a couple different problem solutions, here is the solution I implemented:

Dim myDB As DAO.Database
Dim myTable As DAO.TableDef

Set myDB = CurrentDb()
Set myTable = myDB.TableDefs("CORPDB_MD_STYLE_TBL")
myTable.Connect = "ODBC;DSN=DB2A;DATABASE=;UID=User2040;PWD=Pass1"
myTable.RefreshLink

That does it! Hope this helps someone else.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top