No value given for one or more required parameters

No value given for one or more required parameters

Forum member · May 16, 2008
I have a simple test report working but it fails when I attempt to add a parameter: Here is my query: SELECT i.Agent_ID, i.First_Name, l.Street, l.City FROM [Agent Info] i INNER JOIN [AgentAssignedLeads] l ON i.Agent_ID = l.Agent_ID WHERE i.Agent_ID = #Parameters["AgentID"]# If I replace the last line with: WHERE i.Agent_ID = 'AJN0661' Then it works fine. But with the above code it gives the error: "No value given for one or more required parameters" Here is my code-behind: Partial Class Default2 Inherits DplxWebForm Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim param1 As String = "AJN0061" Parameters.Add("AgentID", param1) DrawPdfToWeb("Invoice.pdf") End Sub End Class What am I doing wrong? Another note: I am using this against an Access 2007 database using OleDB. Thanks Karl

Re: No value given for one or more required parameters

Support · May 19, 2008
Hello Karl, Please try using the following query and it should work. SELECT i.Agent_ID, i.First_Name, l.Street, l.City FROM [Agent Info] i INNER JOIN [AgentAssignedLeads] l ON i.Agent_ID = l.Agent_ID WHERE i.Agent_ID = '#Parameters["AgentID"]#' While passing the parameters you will have to use the single quotes. Thanks, ceTe Software Support Team.