Solved

parameters.refresh fails

Posted on 2002-06-27
5
239 Views
Last Modified: 2012-06-27
vb 6 sp4 ms sql server 7.
Any ideas why the parameters.refresh should fail to update the parameters collection?
TIA
0
Comment
Question by:Philip Pinnell
  • 2
  • 2
5 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7113131
0
 
LVL 13

Author Comment

by:Philip Pinnell
ID: 7113144
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
 
LVL 13

Author Comment

by:Philip Pinnell
ID: 7113179
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
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7113346
Don't leave the question opened. Ask the Community Support for deletion.
0
 
LVL 1

Accepted Solution

by:
Moondancer earned 0 total points
ID: 7113562
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

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question