问题
I have an excel file with roughli 25 oracle connections that I have to refresh. Each one prompts a usn and password input. I would like a vba that prompts for a usn and password once and inputs it in all following prompts.
I have been searching for a way to do this but can not find a suitable solution.
Thank you all in advance.
回答1:
"First of all I would like to know if this is even possible."
In short, yes It all comes down to the connection string. How you go about creating and using that string is up to your requirements and your imagination.
"I have been searching for a way to do this but can not find a suitable solution."
Anecdotal evidence suggests a person suffering from this condition failed to do one it more of the following:
- ask the right question
- recognize the right answer
- to have patience or persistence
- overcome laziness
- access Google
But seriously, I don't know what to tell you, the answer is in comments of the the second link I gave you, Specifically, the third and fourth comment. The third points vaguely toward the connection string and the forth takes you to more helpful commentary.
Refresh a connection in Excel to SQL Server (with password) using VBA
Can I use VBA to "pass" a password to an external database connection in Excel?
来源:https://stackoverflow.com/questions/58228324/refresh-all-but-input-pwd-once