473,659 Members | 2,662 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

errors in asp code

<%
2. option explicit
3. '
4. set fs=CreateObject ("Scripting.Fil eSystemObject")
5. set tfile=fs.Create TextFile("c:\so mefile.txt")
6. test = "Hello World!"
6. tfile.WriteLine (test)
7. '
8. response.write( "<table>") & vbcrlf
9. '
10. for again = 1 to 50
11. for rep = 1 to 100
12. leftcolunn = rep
13. middlecolumn = sqr(rep) * lg(rep)
14. rightcolumn = again * rep
15. response.write( "<tr>") & vbcrlf
16. response.write( "<td>" + leftcolumn + </td>") &
vbcrlf
17. response.write( "<td>" + middlecolumn + </td>") &
vbcrlf
18. response.write( "<td>" + rightcolumn + </td>") &
vbcrlf
19. response.write( "<tr>") & vbcrlf
20. next rep
21. next again
22. '
23. response.buffer = false
24. server.timeout = 10000
25.'
26. </script>

Hi i have to find atleast 5 errors think i found four:
1. leftcolunn should be spelt leftcolumn
2.no <styletag
3.no %close tag
4.no </tableclose tag

help me out please urgent
and i have these tasks to do:

The following is piece of ASP code which has at least 5 fatal
errors - identify what these are and how they can be fixed.
B) Suggest a better way to achieve the functionality show in lines 10
to 21
C) When running this code you get a "permission denied" error for
line 5. Why is this caused and how could you resolve this issue.
D) Write additional ASP code that will send this table generated in
lines 10 to 21 as an HTML e-mail to an e-mail address entered into
an HTML form on the page.
Hemang

Oct 12 '06 #1
5 1261
5
row needs end tag </tr>

6
set fs=Server.Creat eObject("Script ing.FileSystemO bject")
not
set fs=CreateObject ("Scripting.Fil eSystemObject")

7
varaibles not declared, must be delcared if using option explicit

8
middlecolumn = sqr(rep) * lg(rep) what is lg()

9
set tfile=fs.Create TextFile("c:\so mefile.txt")
should have true to overwrite existing file, or page can only run once
set tfile=fs.Create TextFile("c:\so mefile.txt",tru e)
10
response.write( "<td>" + leftcolumn + </td>") &

Use "&" not "+"

also these lines are unnesasary

response.buffer = false
server.timeout = 10000
<he******@gmail .comwrote in message
news:11******** **************@ k70g2000cwa.goo glegroups.com.. .
<%
2. option explicit
3. '
4. set fs=CreateObject ("Scripting.Fil eSystemObject")
5. set tfile=fs.Create TextFile("c:\so mefile.txt")
6. test = "Hello World!"
6. tfile.WriteLine (test)
7. '
8. response.write( "<table>") & vbcrlf
9. '
10. for again = 1 to 50
11. for rep = 1 to 100
12. leftcolunn = rep
13. middlecolumn = sqr(rep) * lg(rep)
14. rightcolumn = again * rep
15. response.write( "<tr>") & vbcrlf
16. response.write( "<td>" + leftcolumn + </td>") &
vbcrlf
17. response.write( "<td>" + middlecolumn + </td>") &
vbcrlf
18. response.write( "<td>" + rightcolumn + </td>") &
vbcrlf
19. response.write( "<tr>") & vbcrlf
20. next rep
21. next again
22. '
23. response.buffer = false
24. server.timeout = 10000
25.'
26. </script>

Hi i have to find atleast 5 errors think i found four:
1. leftcolunn should be spelt leftcolumn
2.no <styletag
3.no %close tag
4.no </tableclose tag

help me out please urgent
and i have these tasks to do:

The following is piece of ASP code which has at least 5 fatal
errors - identify what these are and how they can be fixed.
B) Suggest a better way to achieve the functionality show in lines 10
to 21
C) When running this code you get a "permission denied" error for
line 5. Why is this caused and how could you resolve this issue.
D) Write additional ASP code that will send this table generated in
lines 10 to 21 as an HTML e-mail to an e-mail address entered into
an HTML form on the page.
Hemang

Oct 12 '06 #2
and what do we get for doing your homework for you?
<he******@gmail .comwrote in message
news:11******** **************@ k70g2000cwa.goo glegroups.com.. .
<%
2. option explicit
3. '
4. set fs=CreateObject ("Scripting.Fil eSystemObject")
5. set tfile=fs.Create TextFile("c:\so mefile.txt")
6. test = "Hello World!"
6. tfile.WriteLine (test)
7. '
8. response.write( "<table>") & vbcrlf
9. '
10. for again = 1 to 50
11. for rep = 1 to 100
12. leftcolunn = rep
13. middlecolumn = sqr(rep) * lg(rep)
14. rightcolumn = again * rep
15. response.write( "<tr>") & vbcrlf
16. response.write( "<td>" + leftcolumn + </td>") &
vbcrlf
17. response.write( "<td>" + middlecolumn + </td>") &
vbcrlf
18. response.write( "<td>" + rightcolumn + </td>") &
vbcrlf
19. response.write( "<tr>") & vbcrlf
20. next rep
21. next again
22. '
23. response.buffer = false
24. server.timeout = 10000
25.'
26. </script>

Hi i have to find atleast 5 errors think i found four:
1. leftcolunn should be spelt leftcolumn
2.no <styletag
3.no %close tag
4.no </tableclose tag

help me out please urgent
and i have these tasks to do:

The following is piece of ASP code which has at least 5 fatal
errors - identify what these are and how they can be fixed.
B) Suggest a better way to achieve the functionality show in lines 10
to 21
C) When running this code you get a "permission denied" error for
line 5. Why is this caused and how could you resolve this issue.
D) Write additional ASP code that will send this table generated in
lines 10 to 21 as an HTML e-mail to an e-mail address entered into
an HTML form on the page.
Hemang

Oct 12 '06 #3
Slim wrote:
6
set fs=Server.Creat eObject("Script ing.FileSystemO bject")
not
set fs=CreateObject ("Scripting.Fil eSystemObject")
Not true. This is purely optional. The vbscript version has been reported to
improve performance vs using the Server object's version. Purely anecdotal
but there it is. Using the vbscript version of createobject is not typically
a cause for errors.

http://blogs.msdn.com/ericlippert/ar...01/145686.aspx
>
7
varaibles not declared, must be delcared if using option explicit
By declaring, Slim means to use a "dim" statement, as in:

dim again
>
8
middlecolumn = sqr(rep) * lg(rep) what is lg()
Slim is asking this question because vbscript has no builtin function called
lg(), and you do not seem to have created an array called lg()
10
response.write( "<td>" + leftcolumn + </td>") &

Use "&" not "+"
Good coding practice, but usually not a cause of errors.
>
also these lines are unnesasary

response.buffer = false
server.timeout = 10000
Sure, the timeout is probably unnecessary, but maybe the buffer is not
needed on this page ...

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Oct 12 '06 #4
thank you everyone for contributing brilliant!

Oct 12 '06 #5
<he******@gmail .comwrote in message
news:11******** **************@ k70g2000cwa.goo glegroups.com.. .
<%
2. option explicit
3. '
4. set fs=CreateObject ("Scripting.Fil eSystemObject")
5. set tfile=fs.Create TextFile("c:\so mefile.txt")
6. test = "Hello World!"
6. tfile.WriteLine (test)
7. '
8. response.write( "<table>") & vbcrlf
9. '
10. for again = 1 to 50
11. for rep = 1 to 100
12. leftcolunn = rep
13. middlecolumn = sqr(rep) * lg(rep)
14. rightcolumn = again * rep
15. response.write( "<tr>") & vbcrlf
16. response.write( "<td>" + leftcolumn + </td>") &
vbcrlf
17. response.write( "<td>" + middlecolumn + </td>") &
vbcrlf
18. response.write( "<td>" + rightcolumn + </td>") &
vbcrlf
19. response.write( "<tr>") & vbcrlf
20. next rep
21. next again
22. '
23. response.buffer = false
24. server.timeout = 10000
25.'
26. </script>

Hi i have to find atleast 5 errors think i found four:
1. leftcolunn should be spelt leftcolumn
2.no <styletag
3.no %close tag
4.no </tableclose tag

help me out please urgent
and i have these tasks to do:

The following is piece of ASP code which has at least 5 fatal
errors - identify what these are and how they can be fixed.
B) Suggest a better way to achieve the functionality show in lines 10
to 21
C) When running this code you get a "permission denied" error for
line 5. Why is this caused and how could you resolve this issue.
D) Write additional ASP code that will send this table generated in
lines 10 to 21 as an HTML e-mail to an e-mail address entered into
an HTML form on the page.
Hemang
The easiest way to identify errors is to run the code and see at which line
it falls over. Check the error message, fix it and then run it again. If
you don't understand what an error message means, copy it into google or
www.aspfaq.com, or even google groups.

Two of the errors you've hightlighted aren't fatal, but Slim has already
covered some others that are. "Fatal" means that the script will stop
running and return and error message to the browser. If it runs fine but
looks all messed up, that's the cause of faulty logic or html, not a fatal
error.

In addition, lines 20 and 21 will stop execution with an 'expected end of
statement' error. That syntax is fine for VB and VBA, but not for VBScript.

--
Mike Brind

Oct 12 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2324
by: Douglas Buchanan | last post by:
I am using the following code instead of a very lengthly select case statement. (I have a lot of lookup tables in a settings form that are selected from a ListBox. The data adapters are given a similar name to the table. Rather than making a long Select Case that could become obsolete if lookup tables are added and the source table of the ListBox is edited I came up with this code.) This code works but of course it gives me build...
6
3246
by: Shabam | last post by:
A web application of mine developed using C# + MS SQL runs fine normally. However when I stress test it with a load testing software (using about 60 simultaneous users) some instances start erroring out. I see two different errors. One is a "Object reference not set to an instance of an object." error, which appears to always contain the same information, and the other is a "There is no row at position X.", where X is a number. Is this...
8
1887
by: jon morgan | last post by:
OK, I'm going to be brave. There is a bug in VS.Net 1.1 that causes random compiler errors. I have raised this issue in posts at least three time in the past couple of months without attracting much interest. But it's driving me nuts. Here's what happens. I'm working on a multi project VB app. happily writing nice inoffensive code - go to compile and the compiler tells me there's a problem in a project I'm not working on. But really...
0
2124
by: doli | last post by:
Hi, I have the following piece of code which iterates through the potential errors: i =0 For Each error_item in myConn.Errors DTSPackageLog.WriteStringToLog myConn.Errors(i).Description DTSPackageLog.WriteStringToLog myConn.Errors(i).NativeError i =i +1 Next
2
2585
by: Kavitha Rao | last post by:
Hi, I am getting the following errors while trying to run this snippet in Microsoft Visual C++.Can't seem to print the crc value stored. /* +++Date last modified: 05-Jul-1997 */ /* Crc - 32 BIT ANSI X3.66 CRC checksum files */ #include <stdio.h> #include "crc.h"
10
2207
by: dbuchanan | last post by:
Hello, >From time to time my vb2005 form disappears and is replaced by the following errors. Rebuilding the application never helps. However the errors never affects the operation of my application that I notice, but it is very anoying. To get rid of the errors I must close the form, close the application and then reopen it.
24
5296
by: pat | last post by:
Hi everyone, I've got an exam in c++ in two days and one of the past questions is as follows. Identify 6 syntax and 2 possible runtime errors in this code: class demo {
3
2031
by: clintonb | last post by:
Some programmers, and even Microsoft documents, say you should only throw exceptions for exceptional situations. So how are others handling all the other unexceptional errors? How are you propagating errors up the call stack? In the past, in my C++ code, I used to throw exceptions for ALL errors, exceptional or not. It seemed like a nice clean method for detecting, handling, and propagating errors. You can find multitudes of articles...
11
1670
by: Howard Kaikow | last post by:
I'm using the code below, but an error is not getting trapped. Where can such errors occur? In another process? Try SomeCode Catch ex As Exception Dim strMsg() As String = Split(ex.ToString, vbCrLf) With lstStuff For i = 0 To UBound(strMsg)
0
5055
by: clemrock | last post by:
Help w/ errors.add_to_base between controller and model Hello, I'm having trouble in routing some errors between model and controller. The errors produced in the controller (invite_controller.rb) are collected and spit out nicely in a flash method as such:
0
8427
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8330
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8523
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,...
0
7355
agi2029
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...
1
6178
isladogs
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...
0
5649
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();...
0
4175
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...
0
4334
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.