Solved

Currency (adCurrency) as an Ouput parameter

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Classic ASP migration directions 7 67
SQL Server Web Traffic Limitations 4 53
SMS AddAttachment Protocol Error Classic ASP 10 36
Hide row when retrieving data from database 6 53
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Edureka is one of the fastest growing and most effective online learning sites.  We are here to help you succeed.

911 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

21 Experts available now in Live!

Get 1:1 Help Now