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

Embed a username and password in Excel

Status
Not open for further replies.

Dom71555

IS-IT--Management
Feb 6, 2005
47
US
I would like to use Excel to connect to my MS SQL Server database to run a query that is scripted inside the Excel workbook. Is there a way that the username and password be contained in the workbook so the user does not have the connection box show? It is a generic username and password that is read only.

Thank you for your help!
 
What is your Connection String to connect to your MS SQL Server database?
You can include the Username and Password in it.

Have fun.

---- Andy
 
Thanks Andy...
The connection string looks like this

Provider=SQLOLEDB.1;Persist Security Info=True;User ID=campusro; (just a sample )

I am not sure how to get the password in there. What is the correct syntax for the password? User ID=campusro...what would the password entry look like?
 
You mat try:
Provider=SQLOLEDB.1;Persist Security Info=True;[blue]UID=campusro;PWD=abcxyz"[/blue]

You may find more examples of connection strings here

Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top