hi there, please help me!!!!
************************************************** ****
aspSmartUpload error '800a0009'
Subscript out of range
/try/web/newsletter/newsAddProcess.asp, line 39 ************************************************** ********
so actually i have two pages. news-add.asp and newsaddprocess.asp
it was workin fine yesterday. i probably changed the code accidentally or somethin.. anyway..
code for newaddprocess.asp is below:
************************************************** ********
<%
' Check whether login name already exists
Function Duplicate_name(name)
Dim rsdup, v_count, v_sql
Set rsdup = Server.CreateObject("ADODB.Recordset")
v_sql = "select * "
v_sql = v_sql + " from newsletter "
v_sql = v_sql + " where imgSrc = '" + name + "'"
rsdup.Open v_sql, con, 1, 3
if NOT rsdup.EOF then
duplicate = false
else
duplicate = true
end if
rsdup.Close
set rsdup = nothing
Duplicate_name = duplicate
End Function
%>
<%
xemail=request.querystring("email")
set ors=server.createobject("ADODB.Recordset")
sql="select * from mailinglist where confirm= yes"
ors.open sql,con,1,3
Dim mailObj, subject, fromAddr, strFooter, strHeader, mailist
Dim mailbody
Dim mySmartUpload
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
mySmartUpload.Upload ----->line39
'send email
mailbody = "<h1>" & mySmartUpload.Form("heading") & "</h1>" & "</br></br>" & "<strong>" & mySmartUpload.Form("title1") & "</strong>" & "</br>" & mySmartUpload.Form("content1") & "</br>" & "***************************" & "</br>" & "<strong>" & mySmartUpload.Form("title2") & "</strong>" & "</br>" & mySmartUpload.Form("content2") & "</br>" & "***************************" & "</br>" & "<strong>" & mySmartUpload.Form("title3") & "</strong>" & "</br>" & mySmartUpload.Form("content3") & "</br>" & "***************************"
mailist = mySmartUpload.Form("receipients")
subject = "The Dance Connection Newsletter Issue#" & mySmartUpload.form("issueName")
fromAddr = """The Dance Connection"" <
[email protected]> "
strHeader = "Click" & "<a href =""http://www.pilates-dance.com/try/web/newsletter.asp" & "Here</a>" & "to see online version<br/>"
strFooter = "<br /><br />If you would like to be removed from this mailing list - Click on the link below." & _
"<br />Or Copy and Paste to your browsers address bar" & _
"<br /><br /><a href=""http://www.pilates-dance.com/try/newsletter/common/nl-process.asp?cancel=now"">" & _
"http://pilates-dance.com/try/newsletter/common/nl-process.asp?cancel=now</a><br /><br />" & _
"Thanks<br />" & "The Dance Connection"
Set mailObj = Server.CreateObject("CDONTS.NewMail")
mailObj.BodyFormat = 0
mailObj.MailFormat = 0
mailObj.From = fromAddr
mailObj.Bcc = mailist
mailObj.Subject = subject
mailObj.Body = mailbody
mailObj.Send
Set mailObj = Nothing
'end if
%>
<%
' Variables
' *********
'Dim mySmartUpload
Dim item
Dim value
Dim filesize
Dim file
Dim image
Dim xtoday
Dim xdesc
'Variables for Email
' Object creation
' ***************
'Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
' Upload
' ******
'mySmartUpload.Upload
' FILES Collection
' ****************
file=mySmartUpload.files.item(1).filename
issue=mySmartUpload.Form("issueName")
heading=mySmartUpload.Form("heading")
title1=mySmartUpload.Form("title1")
title2=mySmartUpload.Form("title2")
title3=mySmartUpload.Form("title3")
content1=mySmartUpload.Form("content1")
content2=mySmartUpload.Form("content2")
content3=mySmartUpload.Form("content3")
imgCap=mySmartUpload.Form("imgCaption")
imgTxt=mySmartUpload.Form("img_txt")
addInfo=mySmartUpload.Form("add_info")
xtoday=mySmartUpload.Form("timedate")
xissue = Replace(issue, "'", "??")
xheading = Replace(heading, "'", "??")
xtitle1 = Replace(title1, "'", "??")
xtitle2 = Replace(title2, "'", "??")
xtitle3 = Replace(title3, "'", "??")
xcontent1 = Replace(Replace(content1, "'", "??"),vbcrlf, "<br>")
xcontent2 = Replace(Replace(content2, "'", "??"),vbcrlf, "<br>")
xcontent3 = Replace(Replace(content3, "'", "??"),vbcrlf, "<br>")
ximgCap = Replace(Replace(imgCap, "'", "??"),vbcrlf, "<br>")
ximgTxt = Replace(Replace(imgTxt, "'", "??"),vbcrlf, "<br>")
xaddInfo = Replace(Replace(addInfo, "'", "??"),vbcrlf, "<br>")
' Check wheter file name already exist and the filesize
' ************************************************** ****
filesize=formatnumber((mySmartUpload.Files.TotalBy tes)/1000,0)
if trim(file)<>"" then
if not duplicate_name(file)then
response.redirect "instructorAdd.asp?error=1&name=" & file
else
' Save the files with their original names in a virtual path of the web server
' ************************************************** **************************
intCount = mySmartUpload.Save("../admin/image")
' Database
' ********
mstr="insert into newsletter(IssueNo, Heading, imgSrc, Title1, Title2 , Title3 , Content1, Content2, Content3, imgCaption, imgContent, extraInfo, DateEntered )"
mstr=mstr+ " values('"& xissue&"', '"& xheading&"', '"& file&"', '"& xtitle1&"', '"& xtitle2&"', '"& xtitle3&"', '"& xcontent1&"', '"& xcontent2&"', '"& xcontent3&"', '"& ximgCap&"', '"& ximgTxt&"', '"& xaddInfo&"', '"& xtoday&"')"
end if
else
mstr="insert into newsletter(IssueNo, Heading, imgSrc, Title1, Title2 , Title3 , Content1, Content2, Content3, imgCaption, imgContent, extraInfo, DateEntered )"
mstr=mstr+ " values('"& xissue&"', '"& xheading&"', '"& file&"', '"& xtitle1&"', '"& xtitle2&"', '"& xtitle3&"', '"& xcontent1&"', '"& xcontent2&"', '"& xcontent3&"', '"& ximgCap&"', '"& ximgTxt&"', '"& xaddInfo&"', '"& xtoday&"')"
end if
'response.write(mstr)
con.execute(mstr)
con.close
set con=nothing
response.redirect("newsletter2.asp")
%>