Click to See Complete Forum and Search --> : Cannot use AdExecuteNoRecords


jen
February 23rd, 2000, 01:57 AM
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

Lothar Haensler
February 23rd, 2000, 02:49 AM
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"