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 7282
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,P reGrp,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"
jhardman 3,406
Recognized Expert Specialist
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"
jhardman 3,406
Recognized Expert Specialist
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 problem -- a complex query problem...
I can create a parameter query in a stored procedure, but how do I use
the result set of a parameter query in a select query (in the same or
another sp)? In short, if a select query contains a result table that is
generated as a parameter query, how do I...
|
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
)
RETURNS @groupDeviceLink TABLE (GroupID numeric, DeviceID numeric)
AS
BEGIN
|
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 order.id=orderdetail.id
I know I can uses DataReader class to get data from the store procedue.
However, is there any way for me to use DataAdapter to get the data and put
it in separate DataTables in a DataSet?
|
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 unable to do so.Please help me I am using C#
The code is as
// Put user code to initialize the page here
int ImgID = System.Convert.ToInt32(Request.QueryString);
|
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 the goal is to pass the
"catID" from default.aspx to a stored procedure on the details2.aspx
page.
I can successfully pass the values from the listbox control to a
| |
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 if I run it for finding all
tables and columns that 'table1' depends on
sp_fkeys @fktable_name='table1'
this only takes a second.
|
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, it can get very tedious to debug. Today for example, I wanted
to modify a function that was being called by a trigger. The problem
is that I don't want to change the function, for fear that it is being
called by one of the other SP's or triggers in the database (there are
hundreds of them)
...
|
by: ashtek |
last post by:
Hi,
I have a generic function that executes a stored procedure & returns a
data table.
Code:
===
public static DataTable ExecuteStoredProcedure(string
strProc,SqlParameter paramArray)
{
SqlCommand command = new SqlCommand(strProc, connection);
command.CommandType = CommandType.StoredProcedure;
|
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, Level 15, State 1, Procedure usp_DateDiff, Line 43
Incorrect syntax near the keyword 'SELECT'.
Msg 156, Level 15, State 1, Procedure usp_DateDiff, Line 47
Incorrect syntax near the keyword 'select'.
Msg 156, Level 15, State 1, Procedure usp_DateDiff, Line 52
Incorrect syntax near the keyword...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |