Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

parameters.refresh fails

Posted on 2002-06-27
5
Medium Priority
?
256 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 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
Suggested Courses

885 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