Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Currency (adCurrency) as an Ouput parameter

Posted on 2006-11-22
5
Medium Priority
?
496 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 1000 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

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…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

604 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