Help in Classic ASP calling a Stored Procedure from MSSQL

Hi

I am just a learner in the ASP i wanted to show the sales in a Pivot with the office control i have done the code. But when i am doing on the live server it is not giving any response.

CODE IS AS BELOW
======================
<%@ Language="VbScript" %>



<%
Function toJulian( dt )
Dim dt1
dt1=Cdate(dt)
toJulian = "1" + Right( Year(dt1)*1000 + DatePart( "y", dt1 ), 5 )
End Function
%>





















From Date :
To Date :








<%
'Pivot Table


dim df1,dt1
df1=Request.QueryString("df")
dt1=Request.QueryString("dt")



If df1<>"" and Dt1<>"" Then




Dim oPivot
Dim SQL


Set oPivot = Server.CreateObject("OWC10.PivotTable")

'Connect to the database and provide the commandtext for the rowset.
oPivot.ConnectionString = "Provider=SQLOLEDB; " & _
"SERVER=10.40.1.14;DATABASE=PS_PROD;" & _
"UID=sa;PWD=PSFT;"




SQL="Execute dbo.Sales " & tojulian(df1) & "," & tojulian(dt1)



oPivot.CommandText = SQL


Dim oView
Set oView = oPivot.ActiveView


Dim oCategoryFields, oProductFields, oQtrFields



Set oCategoryFields = oView.FieldSets("ItemDsc")
oCategoryFields.Fields(0).Caption = "ItemDsc"
oView.RowAxis.InsertFieldSet oCategoryFields

Set oCategoryFields = oView.FieldSets("ItemNo")
oCategoryFields.Fields(0).Caption = "ItemNo"
oView.RowAxis.InsertFieldSet oCategoryFields


oView.RowAxis.FieldSets("Itemno").Fields(0).Subtotals(0) = False



Set oQtrFields = oView.FieldSets("Region")
oQtrFields.Fields(0).Caption = "Region"
oView.ColumnAxis.InsertFieldSet oQtrFields



Set oQtrFields = oView.FieldSets("City")
oQtrFields.Fields(0).Caption = "City"
oView.ColumnAxis.InsertFieldSet oQtrFields






oView.DataAxis.InsertTotal oView.AddTotal("Qty", _
oView.FieldSets("Qty").Fields(0), _
oPivot.Constants.plFunctionSum)
oView.Totals("Qty").NumberFormat = "#,##0"



oView.DataAxis.InsertTotal oView.AddTotal("Amt", _
oView.FieldSets("Amt").Fields(0), _
oPivot.Constants.plFunctionSum)
oView.Totals("Amt").NumberFormat = "#,##0"








'Collapse rows and columns.
oView.ExpandDetails = oPivot.Constants.plExpandNever

'Hide the Filter axis and change the PivotTable title.
oView.FilterAxis.Label.Visible = False
oView.TitleBar.Caption = "S A L E S "
oView.TitleBar.BackColor = "Black"

'Change colors and font style for the fields and subtotals.
oPivot.BackColor = "Lavender"
oView.FieldLabelBackColor = "Lavender"
oView.TotalBackColor = "White"
oView.HeaderBackColor = "Gold"

oQtrFields.Fields(0).GroupedBackColor = "MidnightBlue"
oQtrFields.Fields(0).GroupedFont.Color = "Lavender"
oQtrFields.Fields(0).SubtotalBackColor = "Gold"
oQtrFields.Fields(0).SubtotalLabelBackColor = "MidnightBlue"
oQtrFields.Fields(0).SubtotalLabelFont.Bold = True
oQtrFields.Fields(0).SubtotalLabelFont.Color = "Lavender"




oCategoryFields.Fields(0).GroupedBackColor = "MidnightBlue"
oCategoryFields.Fields(0).GroupedFont.Color = "Lavender"
oCategoryFields.Fields(0).SubtotalBackColor = "Gold"
oCategoryFields.Fields(0).SubtotalLabelBackColor = "MidNightBlue"
oCategoryFields.Fields(0).SubtotalLabelFont.Bold = True
oCategoryFields.Fields(0).SubtotalLabelFont.Color = "Lavender"






oView.TotalBackColor = rgb(240,230,117)



Response.Write oPivot.HTMLData
REsponse.Write SQL


End if


%>




MSSQL – PROCEDURE
Drop Procedure [dbo].[Sales2]

Create PROCEDURE [dbo].[Sales2]
@Dt1 NVARCHAR(10),@dt2 NvARCHAR(10)
AS

Select dbo.Fn_ConvertJulianShortDate (SDTRDJ, '') as BDate,b.ABAC11 as Region,D.ALCTY1 as City,SDMCU as Bp,SDDoco as DocNo ,SDDcto as DocType,SDLITM as ItemNo,SDDSC1 as ItemDsc,SDSOQS as Qty,(SDAEXP/100) as Amt,SDAN8 as CustNo,b.ABALPH as CusName
from PRODDTA.F4211 a ,PRODDTA.F0101 b,Proddta.F0101 C, Proddta.F0116 d
Where a.SDAN8=b.ABAN8 And lTRIM(SDMCU) Not in ('221108am','2211shydcl','2211081204')
And Ltrim(A.SDMCU)=Ltrim(C.ABALKY) And C.ABAN8=D.ALAN8
And A.SddctO In('S1','S2','CO')
And A.SDLTTR Not in ('520','910')
And A.SDNXTR Not in ('540')
aND a.sDtrdj>=@dt1 AND A.sDtRDJ<=@dt2
And A.Sddoc>0
Union ALL
Select dbo.Fn_ConvertJulianShortDate (SDTRDJ, '') as BDate,b.ABAC11 as Region,D.ALCTY1 as City,SDMCU as Bp,SDDoco as DocNo ,SDDcto as DocType,SDLITM as ItemNo,SDDSC1 as ItemDsc,SDSOQS as Qty,(SDAEXP/100) as Amt,SDAN8 as CustNo,b.ABALPH as CusName
from PRODDTA.F42119 a ,PRODDTA.F0101 b,Proddta.F0101 C, Proddta.F0116 d
Where a.SDAN8=b.ABAN8 And lTRIM(SDMCU) Not in ('221108am','2211shydcl','2211081204')
And Ltrim(A.SDMCU)=Ltrim(C.ABALKY) And C.ABAN8=D.ALAN8
And A.SddctO In('S1','S2','CO')
aND a.sDtrdj>=@dt1 AND A.sDtRDJ<=@dt2



Execute dbo.sales2 @dt1=112122,@dt2=112140

===========================

Thanks
Naveen