Invalid Parameter when trying to set parameter.expression HRESULT: 0x80070057

Invalid Parameter when trying to set parameter.expression HRESULT: 0x80070057

hozz__
Enthusiast Enthusiast
654 Views
0 Replies
Message 1 of 1

Invalid Parameter when trying to set parameter.expression HRESULT: 0x80070057

hozz__
Enthusiast
Enthusiast

I'm having difficulty with a seemingly simple bit of code, assigning a string to MyParam.Expression in the code below fails with INVALID PARAMETER error HRESULT: 0x80070057

 

AllParams is a previously loaded ParameterList

 

MyParam.Expression = MyString is the statement that fails.

 

    Private Sub SaveParameter(ByVal aParamName As String, ByVal NewExpression As String)
        Dim MyString As String
        Dim MyParam As Parameter

        For i = 1 To AllParams.Count
            If AllParams.Item(i).Name = aParamName Then
                MyParam = AllParams.Item(i)
                MyString = NewExpression
                MyParam.Expression = MyString
            End If

        Next
    End Sub

 

AnyHelp would be appreciated,

 

Marv

0 Likes
655 Views
0 Replies
Replies (0)