rss search

next page next page close

IIS7: Security is Painful for Classic ASP

IIS7: Security is Painful for Classic ASP

An error occurred on the server when processing the URL. Please contact the system administrator

 

I just got a Vista Machine for 30 days in Office, has my new machine may take some time to come and and i wrote some code in good old classic ASP code today. On IIS7 I only got the following though:

An error occurred on the server when processing the URL. Please contact the system administrator

After investigating a bit I figured out that we changed the default for the “scriptErrorSentToBrowser” flag in IIS7. It’s now false and you always get the error above. Here is how to change it:

1) Start an elevated command prompt. Right-click the command shell item in the Start-Accessories menu and select “CMD and run as Administrator”.

2) Run the following command: %windir%\system32\inetsrv\appcmd set config -section:asp -scriptErrorSentToBrowser:true

On Live production Enviroment Once you are done with debugging your ASP app please set it back to false. There are lots of ‘evildoers’ out there! :)

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

next page next page close

Time Base Flagging with ASP datetime function

Time Base Flagging with ASP datetime function

<%

strStartTime1 = "13/02/2012 05:10:00"
strEndTime1 = "16/02/2012 05:11:00"

strDiff1 = DateDiff("n",strStartTime1,strEndTime1)

'response.write strDiff1
'response.write "<hr>"

if strDiff1 >=0  then
%>
<center> <h3>"ORDERS PLACED NOW FOR VALENTINE'S DAY - 14TH FEBRUARY WILL BE DELIVERED LATEST BY 15TH FEBRUARY"</h3> </center>
<%
else

end if 

%>
Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

next page next page close

Dynamic Arrays

Dynamic arrays come in handy when you aren’t sure how many items your array will hold. To create a dynamic array you should use the Dim statement along with the array’s name, without specifying upper bound:

<%
Dim arrCars
arrCars = Array()
%>

In order to use this array you need to use the ReDim statement to define the array’s upper bound:

 

<%
Dim arrCars
arrCars = Array()
Redim arrCars(27)
%>

If in future you need to resize this array you should use the Redim statement again. Be very careful with the ReDim statement. When you use the ReDim statement you lose all elements of the array. Using the keyword PRESERVE in conjunction with the ReDim statement will keep the array we already have and increase the size:

<%
Dim arrCars
arrCars = Array()
Redim arrCars(27)
Redim PRESERVE arrCars(52)
%>
Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

next page next page close

Static Arrays


<%@ LANGUAGE="VBSCRIPT" %>
<%
'Use the Dim statement along with the array name
'to create a static VBScript array
'The number in parentheses defines the array’s upper bound
Dim arrCars(4)
arrCars(0)="BMW"
arrCars(1)="Mercedes"
arrCars(2)="Audi"
arrCars(3)="Bentley"
arrCars(4)="Mini" 

'create a loop moving through the array
'and print out the values
For i=0 to 4
response.write arrCars(i) & "<br>"
Next     'move on to the next value of i
%>

Here is another way to define the array in VBScript:

<%
'we use the VBScript Array function along with a Dim statement
'to create and populate our array
Dim arrCars
arrCars = Array("BMW","Mercedes","Audi","Bentley","Mini") 'each element must be separated by a comma

'again we could loop through the array and print out the values
For i=0 to 4
response.write arrCars(i) & "<br>"
Next
%>
Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

next page next page close

Selected Characters from VBA’s Character Code Set

 

 
Character Code      Character         
8                   backspace        
9                   Tab        
10                  linefeed        
13                  carriage return        
32                  [space]        
33                  !        
34                  "        
35                  #        
36                  $        
37                  %        
38                  &        
39                  '        
40                  (        
41                  )        
42                  *        
43                  +        
44                  ,        
45                  -        
46                  .        
47                  /        
48                  0        
49                  1        
50                  2        
51                  3        
52                  4        
53                  5        
54                  6        
55                  7        
56                  8        
57                  9        
58                  :        
59                  ;        
60                  <        
61                  =        
62                  >        
63                  ?        
64                  @        
65                  A        
66                  B        
67                  C        
68                  D        
69                  E        
70                  F        
71                  G        
72                  H        
73                  I        
74                  J        
75                  K        
76                  L        
77                  M        
78                  N        
79                  O        
80                  P        
81                  Q        
82                  R        
83                  S        
84                  T        
85                  U        
86                  V        
87                  W        
88                  X        
89                  Y        
90                  Z        
91                  [        
92                  \        
93                  ]        
94                  ^        
95                  _        
96                  '        
97                  a        
98                  b        
99                  c        
100                 d        
101                 e        
102                 f        
103                 g        
104                 h        
105                 i        
106                 j        
107                 k        
108                 l        
109                 m        
110                 n        
111                 o        
112                 p        
113                 q        
114                 r        
115                 s        
116                 t        
117                 u        
118                 v        
119                 w        
120                 x        
121                 y        
122                 z        
123                 {        
124                 |        
125                 }        
126                 ~     

 

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

next page next page close

XP / IIS Max Connections

IIS on XP Professional is limited to 10 connections at LocalHost on web server,
But now we can change that "restriction"
using a tool provided by the "Vendor".

Download MetaEdit 

Navigate to the key LM/W3WSVC/MaxConnections

Double click to edit and change to something else.
Note: Max connections on IIS running on Win2k Server is: 2000000000

(Contains 1 attachments.)
Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

next page

IIS7: Security is Painful for Classic ASP

Share|IIS7: Security is Painful for Classic ASP An error occurred on the server when...
article post

Time Base Flagging with ASP datetime function

Share|Time Base Flagging with ASP datetime function <% strStartTime1 = "13/02/2012...
article post

Dynamic Arrays

Share|Dynamic arrays come in handy when you aren’t sure how many items your array...
article post

Static Arrays

Share| <%@ LANGUAGE="VBSCRIPT" %> <% 'Use the Dim statement along with the array...
article post

Selected Characters from VBA’s Character Code Set

...
article post

XP / IIS Max Connections

Share|IIS on XP Professional is limited to 10 connections at LocalHost on web server, But...
article post

Devguru.in is Stephen Fry proof thanks to caching by WP Super Cache