Excel VBA:获取用户数据库登录/连接字符串密码的安全方式? [英] Excel VBA: Secure way to get user's database login/password for connection string?

查看:691
本文介绍了Excel VBA:获取用户数据库登录/连接字符串密码的安全方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个需要查询Oracle的Excel VBA工具。我正在使用ADO。构建连接字符串时,我从数据库,用户名和密码中取出电子表格中的单元格。什么是更安全的方式来处理登录?



电子表格可能会通过电子邮件发送并保存在公共驱动器上。假设普通的Office Professional 2007安装,所以使用第三方控件不太好。

解决方案

通过对话窗口请求数据库,用户名和密码;在与Oracle DB成功连接后,使用SaveSetting()语句将数据库和用户名写入注册表。



在对话窗口的Initialize()事件预加载数据库和用户名使用GetSetting()函数找到保存的值,并将焦点直接移动到密码字段



在XP / Office 2003上的信息将存储在Window的注册表中, p>

  HKEY_CURRENT_USER\Software\VB和VBA程序设置\ [Appname] \ [Section] 

IMHO密码应该|:never:|存储在任何地方



祝你好运MikeD


I have an Excel VBA tool which needs to query Oracle. I am using ADO. When building the connection string, I get the database, username, and password out of cells in the spreadsheet. What is a more secure way to handle the login?

The spreadsheet will probably be emailed and saved on public drives. Assume an ordinary Office Professional 2007 install, so using 3rd party controls is less good.

解决方案

Request database, username and password through a dialog window; after successfull connection to the Oracle DB write out database and username to the registry using the SaveSetting() statement.

In the dialog window's Initialize() event preload database and username with the saved values if found, using the GetSetting() function, and move focus directly to password field

On XP/Office 2003 information will be stored in Window's registry under

HKEY_CURRENT_USER\Software\VB and VBA Program Settings\[Appname]\[Section]

IMHO passwords should |: never :| be stored anywhere

Good luck MikeD

这篇关于Excel VBA:获取用户数据库登录/连接字符串密码的安全方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆