Results 1 to 3 of 3

Thread: Passing User ID and Password to Crystal Reports [RESOLVED]

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2003
    Location
    Chicago, IL
    Posts
    102

    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

  2. #2
    New Member ahpaul's Avatar
    Join Date
    Dec 2002
    Posts
    12
    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

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2003
    Location
    Chicago, IL
    Posts
    102
    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
  •  



Click Here to Expand Forum to Full Width