output parameters problem

Results 1 to 2 of 2

Thread: output parameters problem

  1. #1
    Join Date
    Dec 1969

    Default output parameters problem

    I can bring back a single integer output parameter but not multiple. I know I could bring back the recordset but I understand using output parameters is more efficient. <BR>Can anyone see the problem with this code or point me to a good article on the subject.<BR><BR>The ADO call : <BR><BR>Set AddressDisplayComm = server.CreateObject("ADODB.Command") AddressDisplayComm.ActiveConnection = strConn <BR>AddressDisplayComm.CommandText = "spAddress_Display" AddressDisplayComm.CommandType = adCmdStoredProc <BR>With AddressDisplayComm <BR>.Parameters.Append .CreateParameter("@AddressId",adInteger,4,adParamI nput,AddressId) <BR>.Parameters.Append .CreateParameter("@Address1",adVarChar,adParamOutp ut,40,Address1) .Parameters.Append .CreateParameter("@Address2",adVarChar,adParamOutp ut,40,Address2) .Parameters.Append .CreateParameter("@Address3",adVarChar,adParamOutp ut,40,Address3) .Parameters.Append .CreateParameter("@Address4",adVarChar,adParamOutp ut,40,Address4) .Parameters.Append .CreateParameter("@Address5",adVarChar,adParamOutp ut,40,Address5) .Parameters.Append .CreateParameter("@PostCode",adVarChar,adParamOutp ut,15,PostCode) &#039; Execute the query without returning a recordset <BR>.Execute&#039;, , ADODB.adExecuteNoRecords End With<BR><BR><BR>The stored procedure:<BR><BR>CREATE PROCEDURE dbo.spAddress_Display<BR> @AddressId int,<BR> @Address1 varchar(40) output,<BR> @Address2 varchar(40) output,<BR> @Address3 varchar(40) output,<BR> @Address4 varchar(40) output,<BR> @Address5 varchar(40) output,<BR> @PostCode varchar(15) output<BR>AS<BR><BR><BR>SELECT @Address1 = Address1,<BR> @Address2 = Address2,<BR> @Address3 = Address3,<BR> @Address4 = Address4,<BR> @Address5 = Address5,<BR> @PostCode = PostCode<BR>FROM Addresses<BR>WHERE AddressId = @AddressId<BR><BR>Thanks <BR>Danny<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: output parameters problem

    Hey.. I never put in the variables after the length of the parameters... Can you do that? I always do:<BR><BR>.execute<BR>param1 = cmd.parameters("@param1")<BR>... etc.

Posting Permissions

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