CoverYourASP --> Newsletter archives

Free membership

Join in the fun! Sign in
Member Services

Site navigation
Download the entire site!
Search my articles
Free Magazines
Browse the directory

Send me feedback
Buy my boxer shorts

Recommend this page
Printer-friendly page

Resources I recommend
Link to my site
Advertising slashed!
About your privacy
Legal stuff
Site statistics
115 active users
4787 visitors today
3607 pages today
(only part of today)
Tools I use

Copyright © 1999-2016 James Shaw.
All rights reserved.

RSS submissions

Now open source with SourceForge!

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

Dec 23 2000

Welcome to the latest CoverYourASP newsletter!
"Only two more sleeps" my daughter reminded me this

The site is going to be going through a few changes over
the holidays since Ive got a week off my "real" job!

Lots has happened this week though, as we shall see..

The Diary

17 Dec
- Advertising is here. Slipping in at the top of my ASP
resources on the right-side of every page, there is now a
single spot for advertisers.

18 Dec
- Updated the database admin pages today, specifically
DBEditTable, DBAddRecord and DBEditRecord. I noticed that I
hadn't coped with adding/editing records that contained
single quotes.

To display data containing quotes, I now call
Server.HTMLEncode. In SQL statements I used the regular
expression sData.replace ( /\'/g, '\'\'' ) to change single
quotes to 2 single quotes..

19 Dec
- Completed the first stage of my advertising code - now
storing all banners in new db tables, and tracking impressions
and clickthroughs.

- Changed the advertising model completely. Rather than the
boring same-old model of CPM rates, I now charge by
clickthroughs only - you don't get the traffic, you don't
pay! Don't worry about spiders either - you only pay for IE
and Netscape clickthroughs!

20 Dec
- Modified ShowDiary.asp so that it shows just the last
months worth of entries by default. There is a new link at
the bottom to show the entire diary - scroll down and see!

- My friends at suggested I publish my articles
on a "feed" page, so they could download them. Here it is:

- Uploaded a form to display banner impression/clickthrough
report. See it at

22 Dec
- Bjornar Henden suggested the contact page textarea should
be larger, so I did so. All feedback gratefully received!

- My banner counting code, BannerCounter.asp, was improved
so that only one click per IP address per day was deducted
from the advertisers "pool" of clickthroughs. This stops
malicious users spending the advertisers clicks, and helps
ignore spiders.

- Another big change today, touching over 80 pages. To come
in line with my new advertising push, I modified my page
design to include a standard 468x60 banner. Tidied up a lot
of pages at the same time.

- BannerReports.asp now allows advertisers to move clicks
they have purchased from one banner to another. Only
advertisers can see their stats now - but the rest of you
can see some dummy ones - check it out!


As you can see, most of my time was spent on adding a fully
functional ad serving system to the site. I'm now finished
with what I hope will be a very well-received system.

Read about the terms at

All that remains now is for me to write up a few articles
about how it was implemented. There are a lot of new things
that I haven't discussed before:

- the GetString method of ADODB.Recordset,
- heavy use of Application variables to store all banners,
- a novel use of a single application variable to ignore
multiple clicks from the same IP in a single day,
- the ability to move your purchased clicks between ads,
- and the nicest single form page I've ever written!

I'm hoping to write all this up over the holidays...


Hero of the Week!

Undoubtedly Gavin Williams at He has helped
enormously to help me understand the new and bizarre world
of internet advertising!

Seeing advertising from an advertisers point of view was
invaluable, and one of the reasons that his components are
the sole banners on the site today. (The fact that no-one
has given me any money yet is the other ;-) )

Thanks Gavin.


James Carlisle Ibanez (Jim!) helped out too - pointing out
that I'd uploaded code that crashed when you tried to sign
in! That's a drawback of staying signed in as I do - the
sign in doesnt get tested!


Arthur Flintoff wrote in:

"I have modified the article categories and articles and
they are displaying with missing letters, ie. "Automotive"
is displaying "tomotive".  What would make it do that?"

The first two characters of some fields are used solely to
sort the data - So I can keep the categories and articles
in the order I want. The first two characters are then
stripped off before they are displayed.


Timothy Germer noticed that "When I try to access the
page through IE 4.5 Mac Edition, I get an error.  Do you
know what is happening?"

No idea Timothy, does anyone have access to a Mac that can
print me the screen you see?


Hakan (of fame) helped out again
by noticing a broken link almost straight after I'd
uploaded it. Do you LIVE on my site Hakan?!!


Robert Litz asked an interesting question: "Is there any
way that some of the tables in the database can be hidden
from the screen on the DBAdmin.asp screen?"

Heres how Id do it. Name the hidden ones in a special way,
like prefix them with a "_" character. Then in the code
just skip names that match...

if ( sTableName.charAt ( 0 ) != '_' )
   // display table

and in DBEditTable.asp, make sure they don't try to bypass
the above code by editing the URL directly...

if ( sTableName.charAt ( 0 ) == '_' )
   Response.Redirect ( '/DBAdmin.html' );


William Murray was kind enough to put a prominent link to
my site from his: and also
warned me that some of the ShowSource pages are much wider
than the normal site.

As I explained, this is because some of my code doesnt
contain any characters that browsers will "break" a line
at. So they are forced to widen the page to fit them in.


Database question from "AjishAb":

"In Access 2000 you can only have 255 characters per
field. Ive seen guestbook scripts that save more than that
many characters in to a field. Do you know how it is
done? Thanks."

The answer is to use a memo field, not a text field.


And an interesting one from Ramli:

"Just a question, as your site is supplied with an access
DB, I was wondering if you actually use Access, to serve
your pages. If so, how comes the software is supporting
that many concurrent users ?"

Access 2000 does serve my pages.

Concurrent users is an interesting concept. You know, if
you have 1,000 active users on your site, you may only
have 20 connections open to your database at any particular

Realize that each connection takes a very small amount of
time. I know sites that have 250,000 subscribed members
that run on Access. Obviously they're not all on at once,
but you get the point.

Having said that, my site doesn't write new records to
the database very often. It either reads, or updates
records. I had to disable my statcounter example after 2
weeks because the database grew to over 15mb (it's normally
around 0.7mb).

I have SQL 2000 available on my server, just haven't got
around to moving yet.


Regarding my comment about MapQuest charging for maps,
Jeremy Irish wrote in with a helpful lead:

"Thought you'd be interested. The
allows for free maps online. I noticed on your Yahoo
interface code that Mapquest doesn't allow you to show
their maps without paying. We use the census maps on our
site ( ) for the same reason."


So, after all that, no new articles this week. Lots of
undocumented code added though! As I said before, I
expect quite a few new articles to come out of it. And
if there are any advertisers out there who want to test
their ads...

But first, Christmas! Have a very cool yule everyone, and
forget about ASP for a while. ;-)

James Shaw

[email protected]

Recommend my site to your colleagues, go to
If I've helped you, help me keep going!
To subscribe/unsubscribe from this mail, please visit

Featured sponsor
My favorite resources

I share my content

Supporting ASPRSS

Do you need a quick and easy way to link to my articles? All the information you need is published with ASPRSS...

See my source code
wherever you see this icon...

You can also download the entire site source code for FREE!

New Proposal Kit Professional 5.1
Brand yourself as a top professional: create quotes and amazing proposals and get many legal documents free!

The latter saved me 3 times the purchase price on the first day I owned it!

CoverYourASP Mugs, T-shirts, caps - even Boxer shorts...
I don't make a penny from these, but they're a lot of fun! Don't you need a new mouse mat?

Qualify for Free Trade Magazines

Free subscriptions to industry leading publications for those who qualify!