Non-default parameter not allowed after default parameter

Non-default parameter not allowed after default parameter

Post by Tom Eckar » Sat, 25 Apr 1998 04:00:00



"Non-default parameter not allowed after default parameter."

Anybody ever get this error when using RDO and ODBC to connect to SQL Server
6.5 to run a stored procedure?

I'm writing an app in VB 5.0 that calls out to SQL Server 6.5 through RDO
2.0 and ODBC, but I only get this error on Windows 95 machines, not NT 4.0
machines. And I don't get it on all Windows 95 machines.

I've checked all the procedures on the server and they appear fine.

Any suggestions?

Tom

 
 
 

Non-default parameter not allowed after default parameter

Post by Jon Swee » Tue, 28 Apr 1998 04:00:00


You may want to make sure that you are not improperly invoking a stored
procedure with optional parameters.  RDO apparently can't directly implement
optional parameters -- this is a real issue with the UserConnection object
where the Query objects are created and stored at design time.

To look into this possible problem, do a search on "UserConnection" and
"Optional" at http://support.microsoft.com -- you are looking for a HOWTO:
article on the subject...

jon


>"Non-default parameter not allowed after default parameter."

>Anybody ever get this error when using RDO and ODBC to connect to SQL
Server
>6.5 to run a stored procedure?

>I'm writing an app in VB 5.0 that calls out to SQL Server 6.5 through RDO
>2.0 and ODBC, but I only get this error on Windows 95 machines, not NT 4.0
>machines. And I don't get it on all Windows 95 machines.

>I've checked all the procedures on the server and they appear fine.

>Any suggestions?

>Tom


 
 
 

Non-default parameter not allowed after default parameter

Post by Tom Eckar » Tue, 28 Apr 1998 04:00:00


OK, I'm using RDO but I'm not using a UserConnection.

I started off using UserConnections because I thought they would be faster
and allow more flexibility, but they turned out to be a major pain in the
butt. Dropping and recreating stored procedures forced me to rebuild the

name even though it didn't show up in the query designer. Since I couldn't
predict when this would happen and the code for trapping it was more complex
than I wanted to maintain, I stopped using them.

Here's the VB code I'm using...

*****

Public Function IsToolIDAvailable(conn As rdoConnection, _
    ByVal TestPrefix As String, _
    ByVal TestNumber As Long) _
    As Boolean
'**
'
'   purpose:
'
'   comments:
'
'   history:
'
'**
    Dim oQry As New rdoQuery
    Dim prmAvail As rdoParameter
    Dim prmErrNum As rdoParameter
    Dim prmErrMessage As rdoParameter

    Set oQry.ActiveConnection = conn
    oQry.SQL = "{ ? = call IsToolIDAvailable (?,?,?,?,?,?)}"


    prmAvail.Direction = rdParamOutput


    prmErrNum.Direction = rdParamOutput


    prmErrMessage.Direction = rdParamOutput



    oQry.Execute

    If 0 & prmErrNum.Value = 0 Then
        'success
        IsToolIDAvailable = IIf(0 & prmAvail.Value = 1, True, False)
    Else
        'error
        Err.Raise prmErrNum.Value, "Tool.IsToolAvailable",
prmErrMessage.Value
    End If

End Function

*****

and here's the SQL Server stored procedure it's calling...

/****** Object:  Stored Procedure dbo.IsToolIDAvailable    Script Date:
4/13/98 4:15:53 PM ******/
/*
 returns yes(1) or no(0)(default) through bIsAvailable if the combination
 of sPrefix and iNumber is acceptable.

 raises errors and reutrns no(0) through bIsAvailable if prefix is bad
 of number is out of range
*/

As

*/
--Build tool ID






  begin

  goto Done
  end

--Check if ToolID is used.




 Begin



  goto Done
 end

Done:

*****

All the values go in correctly, but on some machines (always Windows 95
machines), you get the error I mentioned.

Everything looks fine to me when I run it, but sometimes it just doesn't
work.

Tom

 
 
 

1. Non-default parameter not allowed after default parameter

"Non-default parameter not allowed after default parameter."

Anybody ever get this error when using RDO and ODBC to connect to SQL Server
6.5 to run a stored procedure?

I'm writing an app in VB 5.0 that calls out to SQL Server 6.5 through RDO
2.0 and ODBC, but I only get this error on Windows 95 machines, not NT 4.0
machines. And I don't get it on all Windows 95 machines.

I've checked all the procedures on the server and they appear fine.

Any suggestions?

Tom

2. Load Balancing

3. Non-default parameter not allowed after default parameter???

4. Setup Oracle SNMP support

5. Oracle ODBC Driver does not allow DEFAULT parameters

6. detach/attach with cot LOG

7. OUTPUT parameter will not accept default value

8. Default layout not the Default

9. NULL default Parameter value in Stored Procedure doesnt work

10. Default parameter question

11. Defaults of columns and function parameters

12. determining SP parameters with default values