Results 1 to 1 of 1
  1. #1
    Join Date
    Oct 2005
    Posts
    183

    Unanswered: 3421 with multiple parameters ADO

    Running the following code through ADO against SP on SQL-server just doesn't seem to work for me with more than 1 parameter.

    In the following code, parameter 1 is accepted without a problem, but then the fun starts:

    Code:
        kommando.CommandText = "ket.MATCH_addremaining"
        kommando.CommandType = adCmdStoredProc
        kommando.ActiveConnection = forbindelse
        
        kommando.Parameters.Refresh
        
        kommando.Parameters(0) = box_navnmatchgruppe.Value
        kommando.Parameters(1) = text_isokode.Value
        kommando.Parameters(2) = komboboks_org.Value
    At paremter 2 (that is kommando.Parameters(1)) I get

    "Run-time error '3421':
    Application uses a value of the wrong type for the current operation."

    Heres the SP start, and the variables match... if I feed the call to QA in sql-server there is no problem.

    Code:
    CREATE PROCEDURE MATCH_addremaining
    
    @omfang as tinyint,
    @isokode as varchar(2),
    @orgnummer as varchar(4)
    
    AS
    Suggestions, ideas? Thanks,

    Cheers, Trin

    Addition: I've traced the error down to the specific. For some reason, the call parameters(1) returns datatypeenum 17, usignedtinyint, which is similar to the first variable.

    Edit: Problem solved. variables moved from 0,1,2 to 1,2,3 and the procedure runs.
    Last edited by Trinsan; 12-08-05 at 06:42.
    IT squid: networks, servers, firewalls, routers and I dabble a little with SQL-server and Access as well....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •