Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 4th, 2010, 06:35 AM
Authorized User
Points: 410, Level: 7
Points: 410, Level: 7 Points: 410, Level: 7 Points: 410, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 72
Thanks: 17
Thanked 0 Times in 0 Posts
Question Permission denied error

HI,

I have a web site, which was working fine for more than 1 year, But Now i am getting following error :-

Microsoft VBScript runtime error '800a0046'
Permission denied

How to solve this Error..??
 
Old June 4th, 2010, 05:59 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

No code, no help.

You need to find out what line is causing the problem and then show us the code for that line and maybe 10 or 20 lines before and after it.
 
Old June 5th, 2010, 01:57 AM
Authorized User
Points: 410, Level: 7
Points: 410, Level: 7 Points: 410, Level: 7 Points: 410, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 72
Thanks: 17
Thanked 0 Times in 0 Posts
Default

Ok...........Following is the code, Pls help me to do solve this problem, because I am a asp.net man, And I don't know anything about ASP.

Line 9 is highlighted as error.
Microsoft VBScript runtime error '800a0046'
Permission denied


<%
file_being_created= "Resume/form.xls"
set fso = createobject("scripting.filesystemobject")
Dim file
set file = fso.OpenTextFile(Server.MapPath("Resume/serial.txt"), 1)
Dim Line
Line = file.Read(5)
Line=Line+1
Set act1 = fso.CreateTextFile(server.mappath("Resume/serial.txt"), true)
act1.WriteLine(Line)
Set act = fso.CreateTextFile(server.mappath(file_being_creat ed), true)
Set Upload = Server.CreateObject ("Persits.Upload.1")
Upload.Save
Upload.SetMaxSize 1048576
act.WriteLine("<html><body>")
act.WriteLine("<table border=""1"">")
act.WriteLine("<tr>")
act.WriteLine("<td>Serial Number</td><td>" & Line & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>First Name</td><td>" & Upload.Form("first") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Middle Name</td><td>" & Upload.Form("middle") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Last Name</td><td>" & Upload.Form("last") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Position Applied</td><td>" & Upload.Form("pa") & " </td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>E mail</td><td>" & Upload.Form("email") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Mobile</td><td>" & Upload.Form("mobile") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Present Address</td><td>" & Upload.Form("present") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Permanent Address</td><td>" & Upload.Form("permanent") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>************ </td><td>" & Upload.Form("************") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Date of Birth</td><td>" & Upload.Form("date") & Upload.Form("month") & Upload.Form("year") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Height </td><td>" & Upload.Form("height") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Weight </td><td>" & Upload.Form("weight") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Eyesight </td><td>" & Upload.Form("eye") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Can u swim</td><td>" & Upload.Form("swim") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Any chronic illness</td><td>" & Upload.Form("aci") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Specification</td><td>" & Upload.Form("speill") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Political Involvement</td><td>" & Upload.Form("pi") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Specification </td><td>" & Upload.Form("spepi") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<th>Academic Background</th><th></th>")
act.WriteLine("</tr>")
act.WriteLine("<tr><td></td><td>Trade / Stream</td><td>% / Grade</td><td>Yr of Passing</td><td>Institute</td></tr>")
act.WriteLine("<tr><td>SSC</td><td>" & Upload.Form("ssc1") & "</td><td>" & Upload.Form("ssc2") & "</td><td>" & Upload.Form("ssc3") & "</td><td>" & Upload.Form("ssc4") & "</td></tr>")
act.WriteLine("<tr><td>HSC</td><td>" & Upload.Form("hsc1") & "</td><td>" & Upload.Form("hsc2") & "</td><td>" & Upload.Form("hsc3") & "</td><td>" & Upload.Form("hsc4") & "</td></tr>")
act.WriteLine("<tr><td>Dip/Deg</td><td>" & Upload.Form("deg1") & "</td><td>" & Upload.Form("deg2") & "</td><td>" & Upload.Form("deg3") & "</td><td>" & Upload.Form("deg4") & "</td></tr>")
act.WriteLine("<tr><td>P.G./Other</td><td>" & Upload.Form("pg1") & "</td><td>" & Upload.Form("pg2") & "</td><td>" & Upload.Form("pg3") & "</td><td>" & Upload.Form("pg4") & "</td></tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Extra-Curricular activities</td><td>" & Upload.Form("eca") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Marital Status</td><td>" & Upload.Form("ms") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Marriage Date</td><td>" & Upload.Form("dateofmar") & Upload.Form("monthofmar") & Upload.Form("yearofmar") &"</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Spouse Qualification</td><td>" & Upload.Form("sq") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Spouse Occupation</td><td>" & Upload.Form("so") & "</td>")
act.WriteLine("</tr>")

act.WriteLine("<tr>")
act.WriteLine("<td>Number of Children</td><td>" & Upload.Form("noc") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>No. of Dependants</td><td>" & Upload.Form("nod") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<th>Family Members</th><th></th>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>No. of Family Members </td><td>" & Upload.Form("FM") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Brother </td><td>" & Upload.Form("brother") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Sister </td><td>" & Upload.Form("sister") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<th>Professional Details </th><th></th>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<th>Current Employer </th><th></th>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Organisation</td><td>" & Upload.Form("org") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Designaton</td><td>" & Upload.Form("des") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>From</td><td>" & Upload.Form("from") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>To</td><td>" & Upload.Form("to") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Job Description</td><td>" & Upload.Form("jobdes") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<th>Previous Work History</th><th></th>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Organisation</td><td>" & Upload.Form("org2") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Designaton</td><td>" & Upload.Form("des2") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>From</td><td>" & Upload.Form("from2") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>To</td><td>" & Upload.Form("to2") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Job Description</td><td>" & Upload.Form("jobdes2") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<th>Salary </th><th></th>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Current </td><td>" & Upload.Form("salarycurrent") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>Expected </td><td>" & Upload.Form("salaryexpected") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("<tr>")
act.WriteLine("<td>About yourself </td><td>" & Upload.Form("aboutyourself") & "</td>")
act.WriteLine("</tr>")
act.WriteLine("</table></body></html>")
act.close





Dim objMessage

Set objMessage = Server.CreateObject("CDO.Message")

With objMessage
' Set message attributes
.To = "mail@fugro.in"
.From = "careers@fugro.in"
.Subject = "Careers Resume " & Upload.Form("first") & " serial: " & Line
.TextBody = "This email should have an attachment attached!"

' Attachment using known static physical path
'.AddAttachment "form.xls"

' Attachment using mappath to find the physical path

.AddAttachment Server.MapPath("Resume/form.xls")
if Upload.Files.count <> 0 then
For Each File in Upload.Files
File.SaveAs Server.MapPath("Resume/" & File.FileName)
.AddAttachment Server.MapPath("Resume/" & File.FileName)
Next
End IF
'--- Save the file
' upl.Form("FILE1").Save
'upl.Save
'.AddAttachment upl.Form("FILE1")
'End if
' Attachment added directly from a URL
'.AddAttachment "http://www.asp101.com/samples/images/asp101-100x30.gif"

'.Send message
' AFTER you've entered appropriate To and From
' addresses above. Then the script will actually
' send the messages.
'.Configuration.Fields.Item _
'("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
' .Configuration.Fields.Item _
'("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
'="209.200.85.233"
'Server port
' .Configuration.Fields.Item _
'("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
'=25
' .Configuration.Fields.Update
.Send
End With

Set objMessage = Nothing
On Error Resume Next

Response.Redirect "thankyou.html"

%>





Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting a permission denied error in IE 7 disto Javascript 1 September 20th, 2007 08:26 AM
Permission Denied Error interrupt Javascript How-To 6 October 15th, 2004 05:26 AM
IE - Runtime error - Permission Denied bstone VB How-To 2 September 11th, 2004 02:21 AM
Permission Denied Error in VBA ebalch24 Access VBA 3 April 12th, 2004 06:51 PM
Error 70: Permission denied junglem@n VB How-To 2 April 3rd, 2004 03:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.