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

Attaching to Sybase via ODBC

Status
Not open for further replies.

jmeadows7

IS-IT--Management
Jun 13, 2001
148
US
I have several tables linked to SYBASE 12.0 via ODBC. I also have several tables linked to SQLServe 2000.

The following is the code I use to connect to them - I'm only pasting in one example since the code is identical for both except for the connect string.

strConnect = "ODBC;DSN=SCORE_READ;SRVR=SEWP12;DATABASE=sewp;UID=my_read_user;PWD=my_read_pwd;"
Application.SetOption "confirm action queries", 0
Application.SetOption "confirm record changes", 0
Set wrkRemote = DBEngine.Workspaces(0)
Set dbsRemote = wrkRemote.OpenDatabase("", False, False, strConnect)
dbsRemote.Close ' Close database but keep connection.

However, after this code runs to connect to sybase, it prompts me for the password. I've been using this approach since Access 97 - any new ideas how to connec to multiple SQL databases at the same time? I'm fairly sure that I use to connect to multiple databases utilizing this aproach.

Thanks,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top