Stored procs as Chart Rowsources

RLN88360

New member
Local time
Yesterday, 22:16
Joined
Sep 23, 2011
Messages
2
Is there a way to set a chart rowsource on an Access report with a stored procedure containing parameters? Would you perhaps have a code sample to share?

Thank you.
 
Here's code to execute a parameterized stored procedure. This one just does work on the backend, but you could just assign the output of the procedure to a recordset. This code lives in a class, so the paramters (iAthleteID, iTmp) are set as properties of the class object.

Public Sub InsertAthleteExerciseGroupLink()

Dim p1 As New ADODB.Parameter
Dim p2 As New ADODB.Parameter

Set cmd = New ADODB.Command
InitConnection

cmd.ActiveConnection = cn

p1.Direction = adParamInput
p1.Type = adInteger
p1.value = iAthleteID

p2.Direction = adParamInput
p2.Type = adInteger
p2.value = iTmp


cmd.CommandType = adCmdStoredProc
cmd.CommandText = "spInsertAthleteExerciseGroupLink"
cmd.Parameters.Append p1
cmd.Parameters.Append p2

cmd.Execute

Set cn = Nothing
Set cmd = Nothing
Set p1 = Nothing
Set p2 = Nothing


End Sub
 

Users who are viewing this thread

Back
Top Bottom