Stored Procedure problem

Discussion in 'ASP .Net' started by The Clansman, May 19, 2004.

  1. The Clansman

    The Clansman Guest

    Hi, I have the following stored procude in a MDB database:

    SELECT Id
    FROM Users
    WHERE Email=@Email

    I want to get the return value "Id", I'm trying to use:

    Dim param As New OleDbParameter("Id", OleDbType.Integer)
    param.Direction = ParameterDirection.ReturnValue
    cmCommand.Parameters.Add(parameterCustomerID)

    but I get an error "Multiple-step OLE DB operation generated errors. Check
    each OLE DB status value, if available. No work was done."

    thanks,
    Bruno
    The Clansman, May 19, 2004
    #1
    1. Advertising

  2. The Clansman

    Julie Guest

    The Clansman wrote:
    >
    > Hi, I have the following stored procude in a MDB database:
    >
    > SELECT Id
    > FROM Users
    > WHERE Email=@Email
    >
    > I want to get the return value "Id", I'm trying to use:
    >
    > Dim param As New OleDbParameter("Id", OleDbType.Integer)
    > param.Direction = ParameterDirection.ReturnValue
    > cmCommand.Parameters.Add(parameterCustomerID)
    >
    > but I get an error "Multiple-step OLE DB operation generated errors. Check
    > each OLE DB status value, if available. No work was done."
    >
    > thanks,
    > Bruno


    The problem is that a return value can only be a single (variable) value. If
    you truly want to return a value as a parameter, then look into the SQL RETURN
    command.

    Your select statement may return 0, 1, or more records that satisfy the
    condition, entirely depending on the underlying data.

    If you just want the result(s) from your select statement, you don't need the
    ReturnValue parameter, just process the resulting rows after executing the
    command.
    Julie, May 19, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Leon Shaw

    Stored Procedure Problem

    Leon Shaw, Jul 28, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    371
    Jurjen de Groot
    Jul 29, 2003
  2. ElmoWatson

    Stored Procedure/Parameter problem

    ElmoWatson, Aug 4, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    490
    Jerry
    Aug 6, 2003
  3. Bilbo
    Replies:
    3
    Views:
    421
    Bilbo
    Nov 20, 2003
  4. =?Utf-8?B?SnVzdGlu?=

    Problem with stored procedure

    =?Utf-8?B?SnVzdGlu?=, Oct 4, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    3,693
    Larry
    Dec 12, 2008
  5. Mike P
    Replies:
    0
    Views:
    3,297
    Mike P
    Jun 19, 2006
Loading...

Share This Page