Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 17th, 2003, 09:09 AM
Authorized User
 
Join Date: Jul 2003
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default Passing a parameter from VB6 code to Crystal Repor

Hi.
I am passing a parameter from my VB6 code to existing crystal report file. Report is using data from MS SQL database. With out this parameter report is fine. As soon as I pass this parameter, I get an error message: “Logon Failed. Detailes: ADO Error Code: 0x80040e4d. Description: Login failed for user ‘my user name”. SQL State 42000. Native Error 18456
My code is:

Set m_Application = New CRAXDRT.Application
Set m_Report = New CRAXDRT.Report
Set m_Report = m_Application.OpenReport(App.Path & "\ReportName.rpt", 1)
    m_Report.EnableParameterPrompting = False

    Set m_Parameters = m_Report.ParameterFields

    For cnt = 1 To m_Parameters.Count
        Set m_Parameter = m_Parameters.item(cnt)
        If m_Parameter.name = "{?testcode}" Then
           m_Parameter.AddCurrentValue "12345"
        End If
    Next


    frmReportView.CRViewer1.ReportSource = m_Report
    frmReportView.CRViewer1.ViewReport

    frmReportView.Show

Thank you for your help.







Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing Parameter in Crystal report 10 aarunlal ASP.NET 2.0 Professional 2 April 25th, 2007 05:57 AM
crystal report passing multiple parameter noppanit C# 0 March 20th, 2007 12:32 PM
Passing a parameter from VB6 to Crystal Report pavel Pro VB Databases 2 February 2nd, 2005 11:28 PM
Crystal report, passing parameter suni_kutty Crystal Reports 2 October 7th, 2004 03:13 AM
Passing paramters to Crystal 9 from vb6 Gazzoid VB Databases Basics 0 September 17th, 2003 07:45 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.