CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 1999
    Location
    Sweden
    Posts
    33

    Cannot use AdExecuteNoRecords

    Hi
    i have an ADO command that adds a record to Database and returns an outputparameter but no records. I get errormessage 3001 and description "The application is using arguments that are of the wrong type, are out of acceptable range or are in conflict with one another". Bur how else should I use AdExecuteNoRecords. by the way, does it really to much for performance?
    Please take a look at my code:

    Cmd.CommandType = adCmdStoredProc + adExecuteNoRecords 'I recieve errormessage here
    Cmd.CommandText = "stAddPrice"
    con.ConnectionString = UDLPath
    con.Open

    con.BeginTrans
    Cmd.ActiveConnection = con


    for Each Price In colPrice

    With Cmd
    .Parameters.Append .CreateParameter(, adInteger, adParamInput, , Price.ID)
    .Parameters.Append .CreateParameter(, adVarchar, adParamInput, 20, price.Name)
    Parameters.Append .CreateParameter("Myid", adInteger, adParamInputOutput)
    .Execute
    End With

    next

    con.CommitTrans
    con.Close





    Thanks in advance


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Cannot use AdExecuteNoRecords

    IMHO you are using the flag at the wrong place.
    CommandType is NOT a bit flag.
    it should look like this:
    Cmd.CommandType = adCmdStoredProc

    the adExecuteNoRecords is an Option flag that you should specify in your .Execute statement.

    from the docs:
    "adExecuteNoRecords can only be passed as an optional parameter to the Command or Connection Execute method. Using it as an argument to the Command object CommandType property will generate an error"


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured