Solved

Currency (adCurrency) as an Ouput parameter

Posted on 2006-11-22
5
491 Views
Last Modified: 2012-05-05
Hi, i can´t get the following to work:
------------------
Set GccmdSp = Server.CreateObject("ADODB.Command")
GccmdSp.ActiveConnection = Gccst
GccmdSp.CommandText = "Izi_Gfc_Pub_Select_Basket"
GccmdSp.CommandType = 4
GcCmdSp.Parameters.Append GcCmdSp.CreateParameter("@C1ID", 3, 1,, Session("GcC1ID"))
GcCmdSp.Parameters.Append GcCmdSp.CreateParameter("@GiftcardBasketID", 3, 1,, Session("GiftcardBasketID"))
GcCmdSp.Parameters.Append GcCmdSp.CreateParameter("@numDeliveryAddress", 3, 2)
GccmdSp.Parameters.Append GccmdSp.CreateParameter("@DeliveryCost", 6, 2)
set RS = GcCmdSp.Execute
if not RS.EOF then
dim ShowGcBasket: ShowGcBasket = true
dim arrGcBasket: arrGcBasket = RS.GetRows()
end if
dim numDeliveryAddress: numDeliveryAddress = GccmdSp.Parameters ("@numDeliveryAddress").value
dim DeliveryCost: DeliveryCost = cdbl(GccmdSp.Parameters ("@DeliveryCost").value)
RS.Close: set RS = nothing: set GcCmdSp = nothing
--------------------------------

As the parameter DeliveryCost is declared as smallmoney in DB i thought i just had to use adCurrency (6) when i defined the output as above.
dim DeliveryCost: DeliveryCost = cdbl(GccmdSp.Parameters ("@DeliveryCost").value) brings back nothing?

/ jenmat
0
Comment
Question by:jenmat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 

Author Comment

by:jenmat
ID: 17995242
Hmmm, it seems to be in the SP

This doesn´t work
SELECT @DeliveryCost = (SELECT DeliveryCost01 FROM tblCustomerSetting WHERE CustomerID = @C1ID)

but this do
SELECT @DeliveryCost = 20.00

0
 
LVL 9

Expert Comment

by:deathtospam
ID: 17995716
Please try this out and let me know if it works:

====================================
SELECT @DeliveryCost = DeliveryCost01 FROM tblCustomerSetting WHERE CustomerID = @C1ID
====================================


-= DeathToSpam =-


0
 

Author Comment

by:jenmat
ID: 17995802
It doesn´t.
Here´s the SP
----------------------
CREATE PROCEDURE [GiftcardShop].[Izi_Gfc_Pub_Select_Basket]

@C1ID int,
@GiftcardBasketID int,
@numDeliveryAddress tinyint OUTPUT,
@DeliveryCost smallmoney OUTPUT

AS

SET NOCOUNT ON

SELECT     BasketContentID, GiftcardID, GiftcardImageExt, GiftcardValue, GiftcardMessage, CustomerFirstName, CustomerLastName, CustomerAddress1, CustomerZipCode,
                      CustomerCity, C13ID
FROM         Izi_V_Gfc_BasketContent
WHERE     (ConfirmAdd = 1) AND (GiftcardBasketID = @GiftcardBasketID)

SET @numDeliveryAddress = (SELECT     COUNT(DISTINCT ISNULL(C13ID,0))
FROM         Izi_V_Gfc_BasketContent
WHERE     (GiftcardBasketID = @GiftcardBasketID))

SELECT @DeliveryCost = (SELECT DeliveryCost01 FROM tblCustomerSetting WHERE CustomerID = @C1ID)
GO
------------------------------
0
 
LVL 9

Accepted Solution

by:
deathtospam earned 250 total points
ID: 17996008
jenmat --

I'm grasping at straws here, but I'm wondering if the SET NOCOUNT ON is screwing things up at all.  Try tweaking your code like so:

==========================
CREATE PROCEDURE [GiftcardShop].[Izi_Gfc_Pub_Select_Basket]
      @C1ID int,
      @GiftcardBasketID int,
      @numDeliveryAddress tinyint OUTPUT,
      @DeliveryCost smallmoney OUTPUT
AS
      SET NOCOUNT ON
            SET @numDeliveryAddress = (SELECT COUNT(DISTINCT ISNULL(C13ID,0))
            FROM Izi_V_Gfc_BasketContent
            WHERE (GiftcardBasketID = @GiftcardBasketID))

            SELECT @DeliveryCost = (SELECT DeliveryCost01 FROM tblCustomerSetting WHERE CustomerID = @C1ID)
      SET NOCOUNT OFF

      SELECT
            BasketContentID, GiftcardID, GiftcardImageExt, GiftcardValue, GiftcardMessage,
            CustomerFirstName, CustomerLastName, CustomerAddress1, CustomerZipCode,
            CustomerCity, C13ID
      FROM Izi_V_Gfc_BasketContent
      WHERE (ConfirmAdd = 1) AND (GiftcardBasketID = @GiftcardBasketID)
GO
==========================
0
 

Author Comment

by:jenmat
ID: 17996411
Found it, wrong permission for user in SP when selecting from tblCustomerSetting.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question