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

How do I pass database logon information?

Status
Not open for further replies.

aplusc

Programmer
Feb 17, 2002
44
0
0
US
I am trying to use URL reporting on the web and wondering if there is any way I can pass the database logon info without it actually being displayed in clear text. Of course, the simplest way to do this would be user0=username&password0=password, however everybody would see the login information in their url. Another option I tried is creating a simple form with two hidden fields:

<input type=hidden name=user0 value=&quot;username&quot;>
<input type=hidden name=user0 value=&quot;password&quot;>

.. then just having it POST to the .rpt. Obviously this is no good also because anyone could simply view the source of the page and see the login information.

Does Crystal have any descent way I can pass this logon information to the report? Maybe even an ASP session object or something like that?
 
This works great for me. I use this within an asp page.

'==================================================================
' WORKING WITH SETLOGONINFO
'
' The datasource here is called &quot;Automation&quot;. It is a System
' Datasource, and points to the &quot;pubs&quot; database, which is installed
' with SQL Server. You will also need to change your user id and
' password.

userid = &quot;YOUR_DATABASE_USERID&quot;
password = &quot;YOUR_DATABASE_PASSWORD&quot;


session(&quot;oRpt&quot;).MorePrintEngineErrorMessages = False
session(&quot;oRpt&quot;).EnableParameterPrompting = False

' Set the location
set crtable = session(&quot;oRpt&quot;).Database.Tables.Item(1)
crtable.SetLogonInfo &quot;Automation&quot;, &quot;pubs&quot;, cstr(userid), cstr(password)

'==================================================================
'==================================================================

Hope this helps...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top