Using VSView Reporting Edition > Advanced Topics > Data Security > Build a ConnectionString with a User-supplied Password |
This is a very simple alternative. Before rendering a report (or when the control reports a "failed to connect" error), you can prompt the user for a password and plug that into the connection string. For example:
Example Title |
Copy Code
|
---|---|
' build connection string with placeholder for password Dim strConn strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=C:\SecureData\People.mdb;" & _ "Password={{THEPASSWORD}};" ' get password from the user Dim strPwd$ strPwd = InputBox("Please enter your password:") If Len(strPwd) = 0 Then Exit Sub ' build new connection string and assign it to the control strConn = Replace(strConn, "{{THEPASSWORD}}", strPwd) vsr.DataSource.ConnectionString = strConn |