|
-
Feb 2nd, 2004, 11:18 AM
#1
Thread Starter
Lively Member
Passing User ID and Password to Crystal Reports [RESOLVED]
I am using a VB program to call a pre-designed Crystal Reports report that connects to an AS400 Database on ODBC. Not all users will have the same access to the files in the AS400 database that they would need to run the report, so I want either VB or Crystal to supply my user ID and password. I set up the ODBC connection to use my AS400 user ID, but can't find anywhere to pass my password. Does anyone know of a way, either in Visual Basic; ODBC for AS400; or the Crystal Report itself, to tell the report to use my user ID and password?
Thanks in advance.
Last edited by Daywalker46410; Feb 9th, 2004 at 12:30 PM.
Joe Cody
Data Integration Engineer
Novaspect, Inc.
Elk Grove Village, IL
-
Feb 9th, 2004, 10:39 AM
#2
New Member
http://www.vbforums.com/showthread.p...nnection+AS400
http://www.vbforums.com/showthread.p...nnection+AS400
I use a DSN connect to MSAccess DB something like this
Code:
Public cn As New ADODB.Connection
Public rc As New ADODB.Recordset
Public sql As String
cn.Open "DSN=Reporting", "Admin", "password"
The report I do as I pass the recordset to the report template (TTX)
Code:
Public crApp As New CRAXDRT.Application
Public crRep As CRAXDRT.Report
sql = "SELECT * FROM CUSTOMER"
rc.open sql, cn
Set crRep = crApp.OpenReport(App.Path & "\Invoice.rpt")
With crRep
.Database.SetDataSource rc
.PaperSize = crPaperFanfoldUS
End With
frmPreview.Show
For TTX files, you can search the forums
-
Feb 9th, 2004, 12:30 PM
#3
Thread Starter
Lively Member
Thanks. Someone else suggested using the CR Viewer's Connect property to pass the report an ODBC connection string. That seems to be working fine.
Joe Cody
Data Integration Engineer
Novaspect, Inc.
Elk Grove Village, IL
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|