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

How to get logon credentials for currently logged on user.

Status
Not open for further replies.

cfetzer

Programmer
Feb 21, 2003
2
US
Hello all!
I have a .bqy that is currently designed to grab data based upon hard coded logon credentials (in the document scripts) upon startup. Here is an example:

with(ActiveDocument.Sections["QUERY1"].DataModel.Connection)
{
Username = "OracleUser"
SetPassword("Password")
Connect()
}


When the users logs onto the ODS, they will access a .bqy via Insight and when the view the document, it will display data that is grabbed using the above logon.

We need to track users who log in and view data within a .bqy. Is it possible to change the above code, so that it is not using a hard-coded logon.. Instead, grabbing the logon credentials of the currently logged on user and using those credentials to populate the .bqy (on startup) with data?

Thank you all in advance!
Chad
 
Use the ODSUsername value and pass it on to the data model(s).

ActiveDocument.Sections["DataModel"].DataModel.Limits[1].SelectedValues.RemoveAll();
ActiveDocument.Sections["DataModel"].DataModel.Limits[1].SelectedValues.Add(ActiveDocument.ODSUsername);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top