Results 1 to 4 of 4

Thread: Invalid parameter name

  1. #1

    Thread Starter
    Lively Member Carmell's Avatar
    Join Date
    Dec 2015
    Posts
    105

    Invalid parameter name

    Good Day!

    I need your help guys, I'm having a problem calling my report using parameters.
    I got this error.

    Name:  untitled.JPG
Views: 1320
Size:  18.0 KB


    I'm trying to print a report that filters the date selected by the user.

    Code:
      Dim SelectionFormula As String
    
        With CrystalReport1
    
              .Reset
              .Connect = "MyConnection"
     
              .ReportFileName = App.Path & "\Reports\RESIGNEDperBenefits.rpt"
              
              .LogOnServer "pdsodbc.dll", "Connection", GlobalConnDatabase, GlobalConnUsername, GlobalConnPassword
              .RetrieveDataFiles
              .WindowShowCloseBtn = True
              .WindowShowExportBtn = True
              .WindowShowRefreshBtn = True
              .WindowShowPrintBtn = True
              .WindowShowPrintSetupBtn = True
              .WindowState = crptMaximized
              
                .ParameterFields(0) = "Type;" & Text1.Text & ";TRUE"
                .StoredProcParam(1) = DTPicker1.Value
          
                .Action = 1
      End With


    I used the Stored Procedure connected with my report.

    Code:
    set ANSI_NULLS ON
    set QUOTED_IDENTIFIER ON
    go
    
    
    
    ALTER PROCEDURE [dbo].[COEResigned]
    @dt1 as datetime,
    @dt2 as datetime
    AS
    BEGIN
    select * from dbo.view_COEResigned
    where dateresigned between @dt1 and @dt2
    	SET NOCOUNT ON;
    
    END

    Please help me//

  2. #2
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: Invalid parameter name

    I used Crystal Reports once 18 years ago.
    I don't use Stored procedures
    So I may not be much help.
    If you place the file in a nice SHORT simple path like "C:\Reports\" (getting rid of all SPACES as well), it may not solve your problem, but I would sleep much easier.
    I googled for that run time error and got a few hits
    Here is one -
    http://www.tek-tips.com/viewthread.cfm?qid=738819
    where vidru said -
    "Try changing your stored proc params from NVARCHAR to VARCHAR. I set up a test scenario here using the OCX, and got the same error. Once I changed the param to a VARCHAR, no more error."

    I don't know enough (and don't see enough 'code') to know if that will help,
    Rob

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,927

    Re: Invalid parameter name

    Thread moved from the 'VB6 and Earlier' forum to the 'Reporting' forum

  4. #4

    Thread Starter
    Lively Member Carmell's Avatar
    Join Date
    Dec 2015
    Posts
    105

    Smile Re: Invalid parameter name

    thank you for your help

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