Solved

parameters.refresh fails

Posted on 2002-06-27
5
238 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
change vba from autofit to 13.5 width? 4 29
VB 6 error 5 in windows 10 but not in XP 7 56
Automatic Email Reminder 4 37
Publisher:   Unknown     VB.exe Application 1 21
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

773 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