Hello,
I am excecuting a stored procedure in my ASP page , it has one out parameter (@confirm) . after executing the procedure i want to retreive this out parameter and assign it to variable (confirmation) declared in page. - Dim RsSp , SQLSp
-
Set RsSp = Server.CreateObject("ADODB.Recordset")
-
-
-
SQLSp = "Declare @confirm varchar(1)"
-
SQLSp = SQLSp & "Exec SendMsg_proc "& "'" & UniCode &"' , '" & DintUserId &"' , '" & DintOrg_id &"' , '" & Gdate &"' , '" & Gtime &"' ,'" & ProductId &"' , '" &recids&"' , '" &grpids&"' , '" & PreGrp &"' , '" & UnregRec &"' , '" &Message&"' , '" &EmailSubject&"' , '" &MsgType &"','"
-
SQLSp = SQLSp & EMsgBal &"' , '" &GrBal&"' , '" & Acctype &"' , '" &SmsGeneral&"' , '" & EmailGeneral&"' , '" & Free &"' , '" & Normal &"' , '" & Invite &"' , '" & vchStatus &"' , '" & vchStatus1 &"' ," & " @confirm OUTPUT"
-
-
-
RsSp.open SQLSp,openconnection()
-
Set RsSp = Nothing
-
-
how to get this out parameter in page.
Any suggestions.
Regards,
"D"
6 7131
Hello,
I am calling stored procedure in ASP page, but the syntax which i have written is not working, and i am not getting whats the problem. here i have given ASP code for calling stored procedure also SQl stored procedure parameters,
cant figure out the problem. as far i have searched on net i have found that it might be the size of parameter that matters .
and one more question :
out these parameters some of the parameter ( recids,grpids,PreGrp,UnregRec) is string (comma seperated) . is this the cause for error : wrong number of arguments . ASP Code : - Dim adCmdSPStoredProc,adVarChar,adParamInput,adnumeric,adParamOutput
-
adCmdSPStoredProc=4
-
adVarChar = 200
-
adParamInput = 1
-
adInteger = 4
-
adParamOutput = 2
-
adLongVarChar = 8000
-
-
Dim oCmdDim
-
Set oCmd = Server.CreateObject("ADODB.Command")
-
-
With oCmd
-
.ActiveConnection = openconnection()
-
.CommandType = adCmdSPStoredProc
-
.CommandText = "SendMsg_proc"
-
-
.Parameters.Append(.CreateParameter("@UniCode",adVarChar, adParamInput, len(UniCode), UniCode ))
-
.Parameters.Append(.CreateParameter("@DintUserId", adInteger, adParamInput, len(DintUserId), DintUserId ))
-
.Parameters.Append(.CreateParameter("@DintOrg_id", adInteger, adParamInput, len(DintOrg_id), DintOrg_id ))
-
.Parameters.Append(.CreateParameter("@Gdate", adVarChar, adParamInput, len(Gdate), Gdate ))
-
.Parameters.Append(.CreateParameter("@GTime", adVarChar, adParamInput, len(Gtime), Gtime ))
-
.Parameters.Append(.CreateParameter("@ProductId", adVarChar, adParamInput, len(ProductId), ProductId ))
-
.Parameters.Append(.CreateParameter("@recids", adLongVarChar, adParamInput, len(recids), recids ))
-
.Parameters.Append(.CreateParameter("@grpids", adLongVarChar, adParamInput, len(grpids), grpids ))
-
.Parameters.Append(.CreateParameter("@preferedGroup", adLongVarChar, adParamInput, len(PreGrp), PreGrp ))
-
.Parameters.Append(.CreateParameter("@unRegRec", adVarChar, adParamInput, len(UnregRec), UnregRec ))
-
.Parameters.Append(.CreateParameter("@Message", adVarChar, adParamInput, len(Message), Message ))
-
.Parameters.Append(.CreateParameter("@EmailSub", adVarChar, adParamInput, len(EmailSubject), EmailSubject ))
-
.Parameters.Append(.CreateParameter("@DvchMsgType", adVarChar, adParamInput, len(MsgType), MsgType ))
-
.Parameters.Append(.CreateParameter("@EmailMsgBal", adInteger, adParamInput, len(EMsgBal), EMsgBal ))
-
.Parameters.Append(.CreateParameter("@GrBal", adInteger, adParamInput, len(GrBal), GrBal ))
-
.Parameters.Append(.CreateParameter("@AccType", adVarChar, adParamInput,len(Acctype), Acctype ))
-
.Parameters.Append(.CreateParameter("@SmsGeneral", adInteger, adParamInput,len(SmsGeneral), SmsGeneral ))
-
.Parameters.Append(.CreateParameter("@EmailGeneral", adInteger, adParamInput,len(EmailGeneral), EmailGeneral ))
-
.Parameters.Append(.CreateParameter("@vchfree", adVarChar, adParamInput, len(Free), Free ))
-
.Parameters.Append(.CreateParameter("@vchnormal", adVarChar, adParamInput, len(Normal), Normal ))
-
.Parameters.Append(.CreateParameter("@invite", adVarChar, adParamInput, len(Invite), Invite ))
-
.Parameters.Append(.CreateParameter("@status", adVarChar, adParamInput, len(vchStatus), vchStatus ))
-
.Parameters.Append(.CreateParameter("@status1", adVarChar, adParamInput, len(vchStatus1), vchStatus1 ))
-
.Parameters.Append(.CreateParameter("@Confirm", adVarChar, adParamOutput))
-
-
-
'On Error Resume Next
-
.Execute
-
-
-
confirmation = .Parameters("@Confirm")
-
-
End With
-
'On Error Goto 0
-
If oCmd.ActiveConnection.Errors.Count > 0 Then
-
Response.Write("An error occured while trying to process your SP!")
-
Else
-
Response.Write("DONE - "& confirmation)
-
End If
-
-
Set oCmd = Nothing
SQl Stored Procedure parameters : - CREATE PROCEDURE dbo.SendMsg_proc
-
-
@UniCode varchar(1),
-
@DintUserId numeric(9),
-
@DintOrg_id numeric(9),
-
@Gdate varchar(25),
-
@GTime varchar(25),
-
@ProductId varchar(50),
-
@recids varchar(8000),
-
@grpids varchar(8000),
-
@preferedGroup varchar(8000),
-
@unRegRec varchar(8000),
-
@Message varchar(8000),
-
@EmailSub varchar(50),
-
@DvchMsgType varchar(50),
-
@EmailMsgBal numeric(9),
-
@GrBal numeric(9),
-
@AccType varchar(15),
-
@SmsGeneral int,
-
@EmailGeneral int,
-
@vchfree varchar(10),
-
@vchnormal varchar(10),
-
@invite varchar(10),
-
@status varchar(3),
-
@status1 varchar(3),
-
@Confirm varchar(1) output
Since, the above ASP code not working , i used another way, and this is working .
but the problem is , i want the out parameter, dont know how to retreive the out parameter with this syntax : - SQLSp = "Declare @confirm varchar(1)"
-
SQLSp = SQLSp & "Exec SendMsg_proc "& "'" & UniCode &"' , '" & DintUserId &"' , '" & DintOrg_id &"' , '" & Gdate &"' , '" & Gtime &"' , '" & SendDate &"' , '" & ProductId &"' , '" &recids&"' , '" &grpids&"' , '" & PreGrp &"' , '" & UnregRec &"' , '" &Message&"' , '" &EmailSubject&"' , '" &MsgType &"','"
-
SQLSp = SQLSp & EMsgBal &"' , '" &GrBal&"' , '" & Acctype &"' , '" &SmsGeneral&"' , '" & EmailGeneral&"' , '" & Free &"' , '" & Normal &"' , '" & Invite &"' , '" & vchStatus &"' , '" & vchStatus1 &"' ," & " @confirm OUTPUT"
Kindly help me through out this.
Regards,
"D"
D,
I've never tried this before but I'm interested. If you can, send me the code for your SP (OK to mock up and give me something with a similar output) and I will test, see if I can get it to work.
Jared
@jhardman
I have given rough SP , and syntax to execute . - CREATE PROCEDURE dbo.SendMsg_proc_demo
-
-
@UniCode varchar(1),
-
@DintUserId int,
-
@DintOrg_id int,
-
@Gdate varchar(25),
-
@GTime varchar(25),
-
@ProductId varchar(20),
-
@recids varchar(8000),
-
@grpids varchar(8000),
-
@preferedGroup varchar(8000),
-
@unRegRec varchar(8000),
-
@Message varchar(1120),
-
@EmailSub varchar(50),
-
@DvchMsgType varchar(10),
-
@EmailMsgBal numeric(9),
-
@GrBal numeric(9),
-
@AccType varchar(15),
-
@SmsGeneral int,
-
@EmailGeneral int,
-
@vchfree varchar(10),
-
@vchnormal varchar(10),
-
@invite varchar(10),
-
@status varchar(3),
-
@status1 varchar(3),
-
@Confirm varchar(1) output
-
-
AS
-
Begin
-
-
Declare @DvchEMessage varchar(50),@DSentdttime varchar(50),@pos int,@nextpos int,@valuelen int,@PreGrppos int,@nextGrppos int,
-
@valuePreGrplen int,@MsgSendGroup varchar(25),@RecId int,@GrpId int,@unReg varchar(50)
-
-
/*Email Message*/
-
set @DvchEMessage = @Message
-
-
/*Email Subject*/
-
If @EmailSub = ''
-
Begin
-
Set @EmailSub = NULL
-
End
-
-
set @DSentdttime = (select @Gdate +' '+ @GTime)
-
-
If (Convert(int,DATALENGTH(@Message))) > 130
-
Begin
-
set @DvchMsgType = 'lText'
-
End
-
Else
-
Begin
-
set @DvchMsgType = 'Text'
-
End
-
-
-
-
If @recids <> ''
-
Begin
-
-
SELECT @pos = 0, @nextpos = 1
-
-
Print 'Recid befor split'
-
Print @recids
-
-
Print 'Recids after split'
-
-
WHILE @nextpos > 0
-
BEGIN
-
SELECT @nextpos = charindex(',', @recids, @pos + 1)
-
SELECT @valuelen = CASE WHEN @nextpos > 0
-
THEN @nextpos
-
ELSE len(@recids) + 1
-
END - @pos - 1
-
-
SET @RecId = convert(int, substring(@recids, @pos + 1, @valuelen))
-
-
-
Print @RecId
-
-
-
SELECT @pos = @nextpos
-
-
END
-
-
End
-
-
-
If @grpids <> ''
-
Begin
-
Print '@GrpIds before split'
-
Print @grpids
-
-
Print '@preferedGroup before split'
-
Print @preferedGroup
-
-
Print '@GrpIds and @preferedGroup after split'
-
-
SELECT @pos = 0, @nextpos = 1
-
SELECT @PreGrppos = 0,@nextGrppos = 1
-
/* While Group Id's*/
-
WHILE @nextpos > 0
-
BEGIN
-
-
/*Group Id's*/
-
SELECT @nextpos = charindex(',', @grpids, @pos + 1)
-
SELECT @valuelen = CASE WHEN @nextpos > 0
-
THEN @nextpos
-
ELSE len(@grpids) + 1
-
END - @pos - 1
-
-
SET @GrpId = convert(int, substring(@grpids, @pos + 1, @valuelen))
-
-
Print @GrpId
-
-
/*PrefferedGroup*/
-
SELECT @nextGrppos = charindex(',', @preferedGroup, @PreGrppos + 1)
-
SELECT @valuePreGrplen = CASE WHEN @nextGrppos > 0
-
THEN @nextGrppos ELSE len(@preferedGroup) + 1
-
END - @PreGrppos - 1
-
-
SET @MsgSendGroup = substring(@preferedGroup, @PreGrppos + 1, @valuePreGrplen)
-
-
Print @MsgSendGroup
-
-
SELECT @pos = @nextpos
-
SELECT @PreGrppos = @nextGrppos
-
-
END
-
-
End
-
-
-
If @unRegRec <> ''
-
Begin
-
-
Print '@unRegRec before split'
-
Print @unRegRec
-
-
Print '@unRegRec After split'
-
-
SELECT @pos = 0, @nextpos = 1
-
-
WHILE @nextpos > 0
-
BEGIN
-
-
SELECT @nextpos = charindex(',', @unRegRec, @pos + 1)
-
SELECT @valuelen = CASE WHEN @nextpos > 0
-
THEN @nextpos
-
ELSE len(@unRegRec) + 1
-
END - @pos - 1
-
-
SET @unReg = substring(@unRegRec, @pos + 1, @valuelen)
-
-
Print @unReg
-
-
SET @pos = @nextpos
-
-
END
-
-
End
-
-
End
-
-
Set @Confirm = 'Y'
-
-
Print '@UniCode'
-
Print @UniCode
-
Print '@DintUserId'
-
Print @DintUserId
-
Print '@DintOrg_id'
-
Print @DintOrg_id
-
Print '@Gdate'
-
Print @Gdate
-
Print '@GTime'
-
Print @GTime
-
Print '@ProductId'
-
Print @ProductId
-
Print '@recids'
-
Print @recids
-
Print '@grpids'
-
Print @grpids
-
Print '@preferedGroup'
-
Print @preferedGroup
-
Print '@unRegRec'
-
Print @unRegRec
-
Print '@Message'
-
Print @Message
-
Print '@EmailSub'
-
Print @EmailSub
-
Print '@DvchMsgType'
-
Print @DvchMsgType
-
Print '@EmailMsgBal'
-
Print @EmailMsgBal
-
Print '@GrBal'
-
Print @GrBal
-
Print '@AccType'
-
Print @AccType
-
Print '@SmsGeneral'
-
Print @SmsGeneral
-
Print '@EmailGeneral'
-
Print @EmailGeneral
-
Print '@vchfree'
-
Print @vchfree
-
Print '@vchnormal'
-
Print @vchnormal
-
Print '@invite'
-
Print @invite
-
Print '@status'
-
Print @status
-
Print '@status1'
-
Print @status1
-
Print '@Confirm'
-
Print @Confirm
Execute SP (with this syntax in ASP, works): - Declare @Confirm varchar(1)
-
Exec SendMsg_proc_demo 'N','63','1','03/02/2009','10:15:02 AM','demo','1,2,3,4','1,2','default,sms','45,46,47','demo message','demo Sub',
-
'Text','130','6','DEMO ACCOUNT','2','2','','','invite','no','no',@Confirm OUT
Now try the same thing with following syntax in ASP, also, try with some empty parameters , if the variable is empty it throws the following error : - ADODB.Parameters error '800a0e7c'
-
-
Parameter object is improperly defined. Inconsistent or incomplete information was provided.
-
ASP CODE Another way which is causing the problem: - Const adVarChar = 200
-
Const adInteger = 3
-
Const adParamInput = &H0001
-
Const adParamOutput = &H0002
-
Const adCmdSPStoredProc = 4
-
-
-
Dim oCmdDim
-
Set oCmd = Server.CreateObject("ADODB.Command")
-
-
With oCmd
-
.ActiveConnection = openconnection()
-
.CommandType = adCmdSPStoredProc
-
.CommandText = "SendMsg_proc_demo"
-
-
.Parameters.Append .CreateParameter("@UniCode",adVarChar, adParamInput, len(UniCode), UniCode )
-
.Parameters.Append .CreateParameter("@DintUserId", adInteger, adParamInput, len(DintUserId), DintUserId )
-
.Parameters.Append .CreateParameter("@DintOrg_id", adInteger, adParamInput, len(DintOrg_id), DintOrg_id )
-
.Parameters.Append .CreateParameter("@Gdate", adVarChar, adParamInput, len(Gdate), Gdate )
-
.Parameters.Append .CreateParameter("@GTime", adVarChar, adParamInput, len(Gtime), Gtime )
-
.Parameters.Append .CreateParameter("@ProductId", adVarChar, adParamInput, len(ProductId), ProductId )
-
.Parameters.Append .CreateParameter("@recids", adVarChar, adParamInput, len(recids), recids)
-
.Parameters.Append .CreateParameter("@grpids", adVarChar, adParamInput, len(grpids), grpids)
-
.Parameters.Append .CreateParameter("@preferedGroup", adVarChar, adParamInput, len(PreGrp), PreGrp)
-
.Parameters.Append .CreateParameter("@unRegRec", adVarChar, adParamInput, len(UnregRec), UnregRec)
-
.Parameters.Append .CreateParameter("@Message", adVarChar, adParamInput, len(Message), Message )
-
.Parameters.Append .CreateParameter("@EmailSub", adVarChar, adParamInput, len(EmailSubject), EmailSubject )
-
.Parameters.Append .CreateParameter("@DvchMsgType", adVarChar, adParamInput, len(MsgType), MsgType )
-
.Parameters.Append .CreateParameter("@EmailMsgBal", adInteger, adParamInput, len(EMsgBal), EMsgBal )
-
.Parameters.Append .CreateParameter("@GrBal", adInteger, adParamInput, len(GrBal), GrBal )
-
.Parameters.Append .CreateParameter("@AccType", adVarChar, adParamInput,len(Acctype), Acctype )
-
.Parameters.Append .CreateParameter("@SmsGeneral", adInteger, adParamInput,len(SmsGeneral), SmsGeneral )
-
.Parameters.Append .CreateParameter("@EmailGeneral", adInteger, adParamInput,len(EmailGeneral), EmailGeneral )
-
.Parameters.Append .CreateParameter("@vchfree", adVarChar, adParamInput, len(Free), Free )
-
.Parameters.Append .CreateParameter("@vchnormal", adVarChar, adParamInput, len(Normal), Normal )
-
.Parameters.Append .CreateParameter("@invite", adVarChar, adParamInput, len(Invite), Invite )
-
.Parameters.Append .CreateParameter("@status", adVarChar, adParamInput, len(vchStatus), vchStatus )
-
.Parameters.Append .CreateParameter("@status1", adVarChar, adParamInput, len(vchStatus1), vchStatus1 )
-
.Parameters.Append .CreateParameter("@Confirm", adVarChar, adParamOutput)
-
-
-
'On Error Resume Next
-
.Execute
-
-
confirmation = .Parameters("@Confirm")
-
-
End With
-
'On Error Goto 0
-
If oCmd.ActiveConnection.Errors.Count > 0 Then
-
Response.Write("An error occured while trying to process your SP!")
-
Else
-
Response.Write("DONE - "& confirmation)
-
End If
-
-
Set oCmd = Nothing
Regards,
"D"
@jhardman
Hello,
I am calling stored proc in my ASP page,
here d parameters which r passed to SP , are assigned to variables .the values assigned to variables can also be empty.
when i execute SP it throws an error to the line which has variable that is empty.
so, what to do if the variable is empty ..
here's my SP in ASP : - Const adChar = 129
-
Const adVarChar = 200
-
Const adInteger = 3
-
Const adParamInput = &H0001
-
Const adParamOutput = &H0002
-
Const adCmdSPStoredProc = 4
-
Dim oCmdDim
-
Set oCmd = Server.CreateObject("ADODB.Command")
-
-
With oCmd
-
.ActiveConnection = openconnection()
-
.CommandType = adCmdSPStoredProc
-
.CommandText = "SendMsg_proc"
-
-
.Parameters.Append .CreateParameter("@UniCode",adVarChar, adParamInput, len(UniCode), UniCode )
-
.Parameters.Append .CreateParameter("@DintUserId", adInteger, adParamInput, len(DintUserId), DintUserId )
-
.Parameters.Append .CreateParameter("@DintOrg_id", adInteger, adParamInput, len(DintOrg_id), DintOrg_id )
-
.Parameters.Append .CreateParameter("@Gdate", adVarChar, adParamInput, len(Gdate), Gdate )
-
.Parameters.Append .CreateParameter("@GTime", adVarChar, adParamInput, len(Gtime), Gtime )
-
.Parameters.Append .CreateParameter("@ProductId", adVarChar, adParamInput, len(ProductId), ProductId )
-
.Parameters.Append .CreateParameter("@recids", adVarChar, adParamInput, len(recids), recids)
-
.Parameters.Append .CreateParameter("@grpids", adVarChar, adParamInput, len(grpids), grpids)
-
.Parameters.Append .CreateParameter("@preferedGroup", adVarChar, adParamInput, len(PreGrp), PreGrp)
-
.Parameters.Append .CreateParameter("@unRegRec", adVarChar, adParamInput, len(UnregRec), UnregRec)
-
.Parameters.Append .CreateParameter("@Message", adVarChar, adParamInput, len(Message), Message )
-
.Parameters.Append .CreateParameter("@EmailSub", adVarChar, adParamInput, len(EmailSubject), EmailSubject )
-
.Parameters.Append .CreateParameter("@DvchMsgType", adVarChar, adParamInput, len(MsgType), MsgType )
-
.Parameters.Append .CreateParameter("@EmailMsgBal", adInteger, adParamInput, len(EMsgBal), EMsgBal )
-
.Parameters.Append .CreateParameter("@GrBal", adInteger, adParamInput, len(GrBal), GrBal )
-
.Parameters.Append .CreateParameter("@AccType", adVarChar, adParamInput,len(Acctype), Acctype )
-
.Parameters.Append .CreateParameter("@SmsGeneral", adInteger, adParamInput,len(SmsGeneral), SmsGeneral )
-
.Parameters.Append .CreateParameter("@EmailGeneral", adInteger, adParamInput,len(EmailGeneral), EmailGeneral )
-
.Parameters.Append .CreateParameter("@vchfree", adVarChar, adParamInput, len(Free), Free )
-
.Parameters.Append .CreateParameter("@vchnormal", adVarChar, adParamInput, len(Normal), Normal )
-
.Parameters.Append .CreateParameter("@invite", adVarChar, adParamInput, len(Invite), Invite )
-
.Parameters.Append .CreateParameter("@status", adVarChar, adParamInput, len(vchStatus), vchStatus )
-
.Parameters.Append .CreateParameter("@status1", adVarChar, adParamInput, len(vchStatus1), vchStatus1 )
-
.Parameters.Append .CreateParameter("@Confirm", adChar, adParamOutput,1)
-
.Prepared = true
-
-
'On Error Resume Next
-
.Execute
-
confirmation = .Parameters("@Confirm")
-
End With
-
Response.Write(oCmd.Parameters("@Confirm"))
-
-
'On Error Goto 0
-
If oCmd.ActiveConnection.Errors.Count > 0 Then
-
Response.Write("An error occured while trying to process your SP!")
-
Else
-
Response.Write("DONE - "& confirmation)
-
End If
-
-
Set oCmd = Nothing
here's the error : - ADODB.Parameters error '800a0e7c'
-
-
Parameter object is improperly defined. Inconsistent or incomplete information was provided.
-
on this line ,where variable "MsgType " is blank . i.e . there's no value in this variable..it's empty: -
.Parameters.Append .CreateParameter("@DvchMsgType", adVarChar, adParamInput, len(MsgType), MsgType )
-
here's how i have assigned the values to variable in VBScript : -
recids = mid(recids,2,len(recids))
-
grpids = mid(grpids,2,len(grpids))
-
-
-
Dim UniCode,Gdate,Gtime,SendDate,PreGrp,UnregRec,Message,EmailSubject,MsgType,EMsgBal,GrBal,Acctype,Free,Normal,Invite,vchStatus,vchStatus1
-
Dim confirmation
-
-
UniCode = request("unicode")
-
Gdate = Request("Gdate")
-
Gtime = Request("GTime")
-
'SendDate = Request("Gdate") &" "& Request("GTime")
-
PreGrp = Request("preferedGroup")
-
PreGrp = mid(PreGrp,2,len(PreGrp))
-
UnregRec = Request("textareaunreg")
-
-
Message = Request("textareamobile")
-
Message=replace(Message,"'","''")
-
Message=replace(Message,"%","%25")
-
Message=replace(Message,"&","%26")
-
Message=replace(Message,"+","%2B")
-
Message=replace(Message,".","%2E")
-
Message=replace(Message,"/","%2F")
-
Message=replace(Message,Chr(34),"%22")
-
Message=replace(Message,"<","%3C")
-
Message=replace(Message,">","%3E")
-
Message=replace(Message,"#","%23")
-
Message=replace(Message,"*","%2A")
-
Message=replace(Message,"!","%21")
-
Message=replace(Message,",","%2C")
-
Message=replace(Message,"\","%5C")
-
Message=replace(Message,"=","%3D")
-
-
EmailSubject = Request("txtsub")
-
MsgType = Request("tflash")
-
if IsNull(MsgType) or MsgType = "" or IsEmpty(MsgType) then MsgType = "" else MsgType = CStr(MsgType)
-
EMsgBal = Request("EmailBal")
-
GrBal = Request("GrBal")
-
Acctype = lcase(trim(session("admin")))
-
if IsNull(Acctype) or Acctype = "" or IsEmpty(Acctype) then Acctype = "" else Acctype = CStr(Acctype)
-
Free = Request("Free")
-
if IsNull(Free) or Free = "" or IsEmpty(Free) then Free = "" else Free = CStr(Free)
-
Normal = Request("NORMAL")
-
if IsNull(Normal) or Normal = "" or IsEmpty(Normal) then Normal = "" else Normal = CStr(Normal)
-
Invite = Request("invite")
-
if IsNull(Invite) or Invite = "" or IsEmpty(Invite) then Invite = "" else Invite = CStr(Invite)
-
vchStatus = Request("status")
-
vchStatus1 = lcase(trim(session("status1")))
-
if IsNull(vchStatus1) or vchStatus1 = "" or IsEmpty(vchStatus1) then vchStatus1 = "" else vchStatus1 = CStr(vchStatus1)
-
Plz , any suggestion, any help .
i also want the Out parameter in my ASP page.
Regards,
"D"
Hello,
After a long try, i got the solution for my problem and i have solved it. -
recids = mid(recids,2,len(recids))
-
grpids = mid(grpids,2,len(grpids))
-
-
Dim UniCode,Gdate,Gtime,SendDate,PreGrp,UnregRec,Message,EmailSubject,MsgType,EMsgBal,GrBal,Acctype,Free,Normal,Invite,vchStatus,vchStatus1
-
Dim confirmation
-
-
UniCode = request("unicode")
-
Gdate = Request("Gdate")
-
Gtime = Request("GTime")
-
'SendDate = Request("Gdate") &" "& Request("GTime")
-
PreGrp = Request("preferedGroup")
-
PreGrp = mid(PreGrp,2,len(PreGrp))
-
UnregRec = Request("textareaunreg")
-
-
Message = Request("textareamobile")
-
Message=replace(Message,"'","''")
-
Message=replace(Message,"%","%25")
-
Message=replace(Message,"&","%26")
-
Message=replace(Message,"+","%2B")
-
Message=replace(Message,".","%2E")
-
Message=replace(Message,"/","%2F")
-
Message=replace(Message,Chr(34),"%22")
-
Message=replace(Message,"<","%3C")
-
Message=replace(Message,">","%3E")
-
Message=replace(Message,"#","%23")
-
Message=replace(Message,"*","%2A")
-
Message=replace(Message,"!","%21")
-
Message=replace(Message,",","%2C")
-
Message=replace(Message,"\","%5C")
-
Message=replace(Message,"=","%3D")
-
-
EmailSubject = Request("txtsub")
-
MsgType = Request("tflash")
-
if IsNull(MsgType) or MsgType = "" or IsEmpty(MsgType) then MsgType = "''" else MsgType = CStr(MsgType)
-
EMsgBal = Request("EmailBal")
-
GrBal = Request("GrBal")
-
Acctype = lcase(trim(session("admin")))
-
if IsNull(Acctype) or Acctype = "" or IsEmpty(Acctype) then Acctype = "''" else Acctype = CStr(Acctype)
-
Free = Request("Free")
-
if IsNull(Free) or Free = "" or IsEmpty(Free) then Free = "''" else Free = CStr(Free)
-
Normal = Request("NORMAL")
-
if IsNull(Normal) or Normal = "" or IsEmpty(Normal) then Normal = "''" else Normal = CStr(Normal)
-
Invite = Request("invite")
-
if IsNull(Invite) or Invite = "" or IsEmpty(Invite) then Invite = "''" else Invite = CStr(Invite)
-
vchStatus = Request("status")
-
vchStatus1 = lcase(trim(session("status1")))
-
if IsNull(vchStatus1) or vchStatus1 = "" or IsEmpty(vchStatus1) then vchStatus1 = "''" else vchStatus1 = CStr(vchStatus1)
-
-
'----- METHOD ONE TO CALL SP WITH OUTPUT PARAMETER--------------
-
Const adChar = 129
-
Const adVarChar = 200
-
Const adInteger = 3
-
Const adParamInput = &H0001
-
Const adParamOutput = &H0002
-
Const adCmdSPStoredProc = 4
-
-
-
Dim oCmdDim
-
Set oCmd = Server.CreateObject("ADODB.Command")
-
-
With oCmd
-
.ActiveConnection = openconnection()
-
.CommandType = adCmdSPStoredProc
-
.CommandText = "SendMsg_proc"
-
-
.Parameters.Append .CreateParameter("@UniCode",adVarChar, adParamInput, len(UniCode), UniCode )
-
.Parameters.Append .CreateParameter("@DintUserId", adInteger, adParamInput, len(DintUserId), DintUserId )
-
.Parameters.Append .CreateParameter("@DintOrg_id", adInteger, adParamInput, len(DintOrg_id), DintOrg_id )
-
.Parameters.Append .CreateParameter("@Gdate", adVarChar, adParamInput, len(Gdate), Gdate )
-
.Parameters.Append .CreateParameter("@GTime", adVarChar, adParamInput, len(Gtime), Gtime )
-
.Parameters.Append .CreateParameter("@ProductId", adVarChar, adParamInput, len(ProductId), ProductId )
-
.Parameters.Append .CreateParameter("@recids", adVarChar, adParamInput, len(recids), recids)
-
.Parameters.Append .CreateParameter("@grpids", adVarChar, adParamInput, len(grpids), grpids)
-
.Parameters.Append .CreateParameter("@preferedGroup", adVarChar, adParamInput, len(PreGrp), PreGrp)
-
.Parameters.Append .CreateParameter("@unRegRec", adVarChar, adParamInput, len(UnregRec), UnregRec)
-
.Parameters.Append .CreateParameter("@Message", adVarChar, adParamInput, len(Message), Message )
-
.Parameters.Append .CreateParameter("@EmailSub", adVarChar, adParamInput, len(EmailSubject), EmailSubject )
-
.Parameters.Append .CreateParameter("@DvchMsgType", adVarChar, adParamInput, len(MsgType),MsgType)
-
.Parameters.Append .CreateParameter("@EmailMsgBal", adInteger, adParamInput, len(EMsgBal), EMsgBal )
-
.Parameters.Append .CreateParameter("@GrBal", adInteger, adParamInput, len(GrBal), GrBal )
-
.Parameters.Append .CreateParameter("@AccType", adVarChar, adParamInput,len(Acctype), Acctype )
-
.Parameters.Append .CreateParameter("@SmsGeneral", adInteger, adParamInput,len(SmsGeneral), SmsGeneral )
-
.Parameters.Append .CreateParameter("@EmailGeneral", adInteger, adParamInput,len(EmailGeneral), EmailGeneral )
-
.Parameters.Append .CreateParameter("@vchfree", adVarChar, adParamInput, len(Free), Free )
-
.Parameters.Append .CreateParameter("@vchnormal", adVarChar, adParamInput, len(Normal), Normal )
-
.Parameters.Append .CreateParameter("@invite", adVarChar, adParamInput, len(Invite), Invite )
-
.Parameters.Append .CreateParameter("@status", adVarChar, adParamInput, len(vchStatus), vchStatus )
-
.Parameters.Append .CreateParameter("@status1", adVarChar, adParamInput, len(vchStatus1), vchStatus1 )
-
.Parameters.Append .CreateParameter("@Confirm", adChar, adParamOutput,1)
-
.Prepared = true
-
-
'On Error Resume Next
-
.Execute
-
-
End With
-
' If Err.number <> 0 Then
-
' Response.Write "Error Number: " & Err.number & "<BR>"
-
' Response.Write "Error Description: " & Err.Description & "<BR>"
-
' Response.Write "Error Source: " & Err.Source & "<BR>"
-
' Response.End
-
' End If
-
confirmation = oCmd.Parameters("@Confirm").value
-
-
-
'On Error Goto 0
-
If oCmd.ActiveConnection.Errors.Count > 0 Then
-
Response.Write("An error occured while trying to process your SP!")
-
'Else
-
' Response.Write("DONE - "& confirmation)
-
End If
-
-
Set oCmd = Nothing
Regards,
"D"
Sorry I couldn't be of more help, but I'm glad you got it solved. Thanks for posting your solution.
Jared
Sign in to post your reply or Sign up for a free account.
Similar topics
by: WGW |
last post by:
Though I am a novice to MS SQL server (2000 I believe), I can do almost!
everything I need. Maybe not efficiently, but usefully. However, I have
a...
|
by: Mark Oueis |
last post by:
Is there any way I can retrieve the result set of a Stored Procedure
in a function.
ALTER FUNCTION dbo.fn_GroupDeviceLink
(
@groupID numeric
)...
|
by: gh |
last post by:
I have made the following stored procedure with the following select
statement
select * from user
select * from order, orderdetail where...
|
by: Anitha |
last post by:
Hi All,
How to retrieve images stored in Access database.
I am storing images(jpeg) as OleObject.
I want display them on my web page.
I am...
|
by: Ranginald |
last post by:
Hi,
I'm having trouble passing a parameter from my default.aspx page to my
default2.aspx page.
I have values from a query in a list box and...
|
by: keyvez |
last post by:
I am trying to find the tables and columns that depends on 'table1'
sp_fkeys @pktable_name='table1'
and this takes about eight seconds, whereas...
|
by: marcsirois |
last post by:
I am maintaining an application where most of the business rules are in
Triggers, Stored Procedures and User Defined Functions. When a bug
arises,...
|
by: ashtek |
last post by:
Hi,
I have a generic function that executes a stored procedure & returns a
data table.
Code:
===
public static DataTable...
|
by: bbawa1 |
last post by:
I have the following stroed procedue. But whebnnI execute it it gives
me following errors.
Could you please tell me what is wrong
Msg 156,...
|
by: tammygombez |
last post by:
Hey fellow JavaFX developers,
I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
|
by: tammygombez |
last post by:
Hey everyone!
I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
|
by: concettolabs |
last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
|
by: CD Tom |
last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
|
by: jalbright99669 |
last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was...
|
by: Matthew3360 |
last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function.
Here is my code.
...
|
by: Matthew3360 |
last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
| |