|Pick a newsletter to read - you can receive these every Saturday by subscribing.|
You can also read the article that describes how this is implemented.
|undefined NaN NaN|
Jun 5 2002
Apr 30 2002
Mar 31 2002
Feb 28 2002
Jan 23 2002
Jan 22 2002
Jan 15 2002
Jan 14 2002
Jan 7 2002
Dec 24 2001
Dec 11 2001
Nov 27 2001
Nov 12 2001
Aug 1 2001
Jul 14 2001
Jun 24 2001
Jun 10 2001
May 26 2001
May 12 2001
Apr 30 2001
Apr 22 2001
Apr 14 2001
Apr 8 2001
Mar 29 2001
Mar 24 2001
Mar 17 2001
Mar 10 2001
Mar 3 2001
Feb 24 2001
Feb 17 2001
Feb 10 2001
Feb 3 2001
Jan 27 2001
Jan 20 2001
Jan 13 2001
Jan 6 2001
Dec 30 2000
Dec 23 2000
Dec 16 2000
Dec 9 2000
Dec 2 2000
Nov 29 2000
Nov 25 2000
Nov 18 2000
Nov 11 2000
Nov 4 2000
Oct 28 2000
Oct 21 2000
Oct 14 2000
Oct 9 2000
Oct 7 2000
Oct 3 2000
Oct 1 2000
Sep 29 2000
Sep 27 2000
Sep 25 2000
Sep 23 2000
Sep 21 2000
Sep 18 2000
Sep 14 2000
Sep 11 2000
Feb 10 2001____________________________________________________________
C o v e r Y o u r A S P . c o m
Welcome to the latest newsletter!
I'd like everyone to come to an agreement. Get together and
decide on a rota system to use so I get emails spread out
evenly, no more than 10 a day. ok?
Last week, I got no interesting emails to put in here, this
week I had so many that I haven't even had a chance to
answer them! If you're one of those, I apologize.
A lot of you have asked questions, and know how quickly I
try to respond, but it's getting harder!
I've put off adding a forum to the site, thinking that there
were plenty of places to ask questions elsewhere. There are
of course, but a forum would at least allow Hakan, who lives
on the site anyway, to share the task of answering the
How about this, for a start. If it's not CYA-related, join
the relevant list at http://asplists.com/ and ask there.
After all, that's what I do when you ask *hard* questions...
A W O R D F R O M M Y S P O N S O R S
Download The VisualASP Component Pack v3.1 and start creating
fast, light weight web applications using ASP technology. Try
the new TabView Component plus updated TreeView, ListView and
MonthView Components. The Component Pack now contains an easy
to install (local) examples site showing demonstrations and
ASP Script source for each component.
Download Version 3.1 Now.
T H E D I A R Y
The events of the last week
- All my work has been offline this week, but I did notice
something that made me laugh out loud...has no-one noticed
that I'd used length="20" in my forms to set the length of
the inputs? There's no such attribute - it should be
size="20"!! I only made the mistake once, then copy and
pasted it everywhere else...don't we all make silly
- Improved the Search.asp SSI - thanks to Hakan Eskici
again - reserved characters (like ' or %) are now stripped
from the search expression using the line below:
sSearch = sSearch.replace ( /['"%]/g, '' );
- I've added a new flag to config.asp - bStoreStats - that
controls whether I store statistics about people visiting
R E C O M M E N D T H E S I T E !
Please recommend my site to your colleagues
Three new articles this week:
"Getting feedback emails from a <form>"
Walk step-by-step through the feedback form and email code,
with pages devoted to CDONTS, JMail and ASPMail...
From Email-related examples, published 9 Feb
"Implementing <form>'s with ASP"
Here I show you the ASP code common to all forms I write,
with discussions on validation and field persistance.
From HTML tips and tricks, published 9 Feb
"Web sites based on CoverYourASP's code"
You realize by now that you can download the entire site,
right? See others that have gone before you...
From The CoverYourASP site, published 6 Feb
H E R O O F T H E W E E K !
Last week I laid into an ISP's treatment of a reader when
they forced him into placing his database in a folder outside
his web site.
David Rahrer took the time to send in a very informed and
very polite response that immediately made him this weeks
Hero of the Week:
"I think you were a little quick in your judgement of Randy's
ISP for a couple of reasons.
1) While I have never heard of putting all databases in the
*same* folder on the server, we put them in a specific
"database" folder on the same level as the webroot for each
client web. The client has FTP access to this folder and
the database is kept outside the relatively open environment
of the web server. We actually encourage the use of DSN-less
connections, but would never allow the database to be left
in the web, and therefore Server.MapPath( ) has to be
replaced with a hard path. I think it is inconvenient if not
improper to leave this choice out of code.
2) Since the actual path to the webroot can easily be
established using the "PATH_TRANSLATED" server variable, it's
not really a big deal to disclose this to a user for their
While some hosts may very well try to increase profits by
enforcing the use of system DSN's, there are much better
motives for moving the db out of the web server. In any
case, I would be very suspect of a host that *allowed* the db
to be left in the web server. IMHO, it isn't good practice
and leaves the client, not the host, at a disadvantage. Of
course, it does depend some I suppose on how much you value
the security of the data being stored. We deal with a lot of
e-commerce and there is obviously a need to be more careful,
but the policy is followed for everyone.
One other thing you might consider when using
Server.MapPath( ) is that some hosts also disable the use of
"parent paths", making it impossible to walk up the directory
structure (../). I think this is actually still a security
check recommended by MS in IIS5. Many don't do it because
it's a pain to deal with the issue when an app that has been
designed to depend on this won't work, but there are a few
that do. Just FYI :-)
If you have anything that might add to or contradict any of
this, I would be very willing to listen. Take care."
Unfortunately, David didn't give a hint what ISP he works for,
if any, so I can't promote them.
A W O R D F R O M M Y S P O N S O R S
Get FREE sample code, online utilities, and articles at
Add intelligence to your ASP applications! Look up Whois
records, check email addresses, do DNS lookups, find network
problems with Ping and Traceroute, and more.
N E E D A N A S P I S P ?
Use mine. You won't find a nicer bunch of guys.
Cheap, efficient and extremely helpful.
Frank Wood was runner-up Hero this week. His first of many
emails this week started with a sentence that made me laugh:
"James, I appreciate that you are "giving back to the
programming community, but.. Hand Picked Words? Are you
nuts or do you just have an enormous amount of time on your
Uhh, I don't have *any* time, so I guess I'm nuts.
Frank and I had a discussion about the best way to index
and search words automatically picked from the HTML of my
pages - even sending his list of "common words" to discard.
A W O R D F R O M M Y S P O N S O R S
Developersdex delivers the world's largest index for
Microsoft web technologies. Search, post, and reply to over
13 of the most popular ASP, SQL, VB and XML Usenet newsgroups.
Devdex indexes over 5,000 new resources everyday including
those from MSDN, ASP.NET, 15seconds, 4guysfromrolla,
ASPToday, XML and ActionJackson.com just to name a few.
If it's on the NET it's on Devdex!
F E E D B A C K
Have something to say? Please share!
"Just wondering if you knew that your test account is pretty
easy to guess. If you dont mind people accessing your test
I have a thing about security. B-}"
Thanks Rob, but that account is deliberately there for
people to play with!
"I have a personal web site and would like to display
current time in Sydney. Unfortunately my host server is in
USA. I'm using the Now() function
<%=now() + 0.583%>
Displays in the following format.
2/5/01 6:13:58 AM
The date and time are accurate. Is there any way, I can
display the date and time in a better format such as:
Monday, February 5, 2001 - 6:13:58 AM"
There's an example of better date formatting in
To add so many hours to a date, do this:
Var d = new Date ( );
d.setHours ( d.GetHours( ) + 9 ); // add 9 hours
"I have seen in most of the search programs that they
display "abc.asp?prodID=123" rather than the destination
I THINK what exectly happens is that they maintain a sort
of database containing ID and its values i.e. like if
ID=123 it will direct the hyperlink to
"http://www.microsoft.com". So there must be some place
where these ID and their respective values must be kept"
You need a redirect page that understands the id=123,
looks it up in a database, then redirects to the correct
URL. This works wherever the new page is, your site or
You just need code like this in a file called
redirect.asp. I haven't even run this, so there may be a
typo or two - let me know!
<!--#include file = "include/Config.asp"-->
<!--#include file = "utils/Database.asp"-->
var nID = Request.QueryString( 'ID' ) - 0;
DBInitConnection ( );
DBGetRecords ( 'SELECT URL FROM RedirectTable WHERE ID=' + nID );
var sURL = 'sorry.asp'; // go to sorry page when id not found
if ( !oRecordSet.EOF )
sURL = '' + oRecordSet ( 0 );
DBReleaseConnection ( );
Response.Redirect ( sURL );
"I am using your method of looping through all fields, and
showing all records which match a certain criteria. I was
wondering how I could use alternate text, ie "No records are
available to be displayed", if there are no records in the
record set. Someone was telling me that using BOF was a way,
but I am not sure."
Hi Lee, I use:
DBGetRecords( 'SELECT Field from SomeWhere' );
if ( oRecordSet.EOF )
Out ( 'oops...' );
while ( !oRecordSet.EOF )
// do something..
"Greetings from the UK!
Came across your site via a link from another resource
yesterday, and what I must say is "What a find".
I eagerly signed up for membership, registered for the
newsletter, and downloaded the source code for the site.
I was trying not to demonstrate my naivety in these matters,
and was hoping that through your excellently compiled
documentation, and extensive trouble shooting guides to have
solved my problem, but alas no.
Under normal circumstance I would perhaps have given up and
gone and washed the car or similar, but recognising the
potential that exists for me in resolving this issue (I'm on
a steep learning curve) I would appreciate a few words of
wisdom - I would like to think that in the not to distant
future I could be asking your permission to use the code in
a live site.
Here goes with the error messages I am confronted with when
the default page has loaded:
An error has occurred whilst connecting to the database:
"Could not find installable ISAM."
I have altered (many times and combinations) the config file
to reflect my installed components. I am running on PWS under
WIn98 with MDAC Microsoft.Jet.OLEDB.4.0 installed."
Hi Chris, welcome aboard! You are the first to report this
error, so I looked it up on MSDN. Please have a look through
these, and if possible let me know which, if any, fixed the
problem. I can then update my troubleshooting page.
Good luck. It looks like a corrupt DLL or registry entry...be
"I setup my PWS correctly, unzipping the files and pointing PWS
to them as I should. I am getting a JScript error now which I
am not certain how to correct.
Can you provide some assistance perhaps? :)"
Microsoft JScript compilation error '800a03ea'
D:\CYASP\CYA\INCLUDE\../utils/Database.asp, line 94
Hi Mike. You need to be using JScript v5 to use exception
handling. You can install it from the Microsoft Visual InterDev
6.0 CD or download from the Microsoft Scripting web site at
"I just wanted to offer a point for consideration. Many of
your articles are biased towards performance and optimized
code over easily maintainable, extensible design. There is
a tremendous trade-off. When desiring to update the user
interface, an experienced programmer is required rather than
a graphics/usablilty expert. This ties up programmer resources
who could be adding valuable functionality while the pictures
and page-flow are handled independantly.
On the other hand, a hybrid component that runs through the
source ASP pre-scripts it? Start with converting HTML blocks
into script calls, then remove white space. When that's
stable, scan for known performance bottle-necks, repeated
code, etc. I bet large web-sites would dig that. Especially
those with high-volume and slow load time... It would
require a programmer with interest in high-performance ASP and
knowledge of more powerful compiled languages..."
I've had the same thoughts. But with ASP.NET coming soon,
there seems little point in it. "Classic ASP" will be used for
a few more years I'm quite sure, so this site has some life
left in it, but CoverYourASP.NET is definitely the future...
"I have a database with 2 tables. I would like to produce to
list boxes showing the existing data in the two boxes. With
buttons like 'Arrows' to select an item from one list and move
it to the other list. Then of course a button to delete records
in either list and then a save button which will update both
I haven't got any code to do that, but I guess you have two
options - mainly server-side or mainly client-side. Obviously
manipulating the list boxes on the client would be more
efficient, then submitting the data back to the server with
your save button. From what I've seen of DHTML, this is not
difficult, but obviously client-side scripts must be able to
run. You're limiting your site to newer browsers with
non-paranoid users only. Your choice.
Or, do it all server-side with the left/right buttons
submitting the change to the server, who then sends a new page.
Lots of roundtrips to the server, but guaranteed to work with
any form-enabled browser.
H A V E I H E L P E D Y O U ?
If I've helped you, help me help others!
There are some really cool ideas coming to fruition in the
next few weeks. I'm not telling, not even a hint. Really.
But you guys and gals are going to *LOVE* it!
Speak to you next week.
885 Woodstock Road, Suite 430, #108
Roswell, GA 30075-2247, U.S.A.
V O T E F O R Y O U R F A V O R I T E S I T E
(or don't, if it's not CoverYourASP.com)
S U B S C R I P T I O N S
Do you want to subscribe or unsubscribe?