parameters.refresh fails

vb 6 sp4 ms sql server 7.
Any ideas why the parameters.refresh should fail to update the parameters collection?
TIA
LVL 13
Atdhe NuhiuAsked:
Who is Participating?
 
MoondancerConnect With a Mentor Commented:
50 points refunded rather than deleted and moved to PAQ at zero to close, since the problem and solution were posted by Andy and may help others with similar roadblocks.
Thanks,
Moondancer - EE Moderator
0
 
Atdhe NuhiuAuthor Commented:
lngPartyID As Long, _
  strErrorMessage As String) As Integer

  'Runs stRDRAPIGetUserPermissions stored procedure
 
  Dim objCmd As ADODB.Command
  Dim objRS As ADODB.Recordset
 
  On Error GoTo ErrHandler
 
  gblnReadWrite = False
  gblnReadOnly = False
 
  Set objCmd = New ADODB.Command
  With objCmd
 
    'set up command object
    Set .ActiveConnection = db.Connection
    .CommandText = "stRDRAPIGetUserPermissions"
    .CommandType = adCmdStoredProc
    .Parameters.Refresh
   
    'populate command object with parameter values
    .Parameters("@iRoleScheme").Value = "ISA/PEP MANAGER"
...
the error occurs in this last line as this parameter does not exist. parametrs.count = 0.
Error is "item cannot be found in this collection ... etc"

Sorry but what do you mean by provider?
0
 
Atdhe NuhiuAuthor Commented:
Thanks for your interest but I have found the problem. In actual fact the stored procedure could not be found but it didn't tell me this until after I had changed the code to manually add the parameters.

0
 
Éric MoreauSenior .Net ConsultantCommented:
Don't leave the question opened. Ask the Community Support for deletion.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.