Solved

Currency (adCurrency) as an Ouput parameter

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

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 information …
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

706 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

15 Experts available now in Live!

Get 1:1 Help Now