【问题标题】:Add Input Box to insert username, password for VBA Excel to Teradata query添加输入框以将 VBA Excel 的用户名、密码插入 Teradata 查询
【发布时间】:2014-03-07 06:37:24
【问题描述】:

我有在 Teradata 中运行 SQL 查询并将结果返回 Excel 的 VBA excel 代码。出于安全原因,我希望弹出一个“输入框”供用户输入他们的用户 ID 和密码,而不是将其放在代码本身中,而不是以下内容(我的代码中有)。任何想法/这可能吗?我以前曾使用过消息框和输入,但对于如何在这种情况下执行此操作感到困惑。谢谢!

 connect.Open "Data Source=****; Database=****; Persist Security Info=True; User ID=****; Password=****; Session Mode=ANSI;"

【问题讨论】:

    标签: sql excel teradata vba


    【解决方案1】:
    strUser = InputBox("User ID")
    strPwd = InputBox("Password") 
    connect.Open "Data Source=****; Database=****; Persist Security Info=True; User ID=" & strUser & "; Password=" & strPwd & "; Session Mode=ANSI;"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-07-04
      • 1970-01-01
      • 1970-01-01
      • 2017-10-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多