Solved

Currency (adCurrency) as an Ouput parameter

Posted on 2006-11-22
5
479 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
  • 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

816 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now