Skip Navigation

ASP / VBScript Cheat Sheet

 
The ASP cheat sheet is designed to act as a reminder and reference sheet, listing various of the oft-forgotten parts of ASP / VBScript. I no longer work full-time with ASP, so to ensure the cheat sheet was as helpful as possible, I roped in one Allan Wenham, an excellent ASP developer, to assist. Thanks Al!

A description of what is on the cheat sheet follows, or if you are impatient, you can go straight to the full size ASP cheat sheet.


Regular Expressions


Thumbnail highlighting regular expressions section.


VBScript has support for regular expressions, for pattern matching and replacements in strings. This section lists the various symbols used in regular expression patterns along with their meanings.

Date Function Arguments


Thumbnail highlighting date function arguments.


VBScript's date function(s) can take several different arguments, all with their own simple codes (eg Year, Month, Day, Week etc). This section lists these codes and meanings.

Redirect With 301 Header


Thumbnail highlighting 301 redirect section.


I appreciate this is a little unusual for a cheat sheet, but I find myself needing this with alarming regularity. VBScript's Response.Redirect function by default sends a "302" header, telling the recipient the page they were looking for has moved temporarily. A "301" header tells the recipient the page has moved permanently - and in SEO terms the ability to send 301 headers is very important. These lines of code are an alternative to Response.Redirect.

Include a File


Thumbnail highlighting include file section.


I had a little space here. A very little space. So 1 line of code that might prove useful has been roped in to fill it - the code you need to include a file.

Function Argument Orders


Thumbnail highlighting function argument orders section.


Function argument orders are possibly the easiest thing in almost any language to forget. This section lists some common functionns with their argument orders.

File Modes


Thumbnail highlighting file modes section.


When opening files, you can do so in several different ways, each requiring a different file mode. There are not many, but they are easy to forget - and this section lists the 3 file modes with what they do.

Common LCID Codes


Thumbnail highlighting common LCID codes section.


LCID codes are used to determine location-related settings, such as date formats, among other things. Personally I find myself fairly often hunting around for LCID code lists. This section lists the most common LCID codes, for the UK, US, France, Germany and Spain.

Constants


Thumbnail highlighting constants sections.


These three sections list several of the constants used in VBScript. The Date, Comparison and String constants seem to be the ones that people most often use and can least often remember offhand.

Methods and Properties


Thumbnail highlighting methods and properties lists.


The Request, Response, Session - and so on - objects all have a variety of methods and properties. This section lists methods and properties with each object.

Functions


Thumbnail highlighting functions list.


The functions list contains some of VBScript most used functions, for working with strings, dates, arrays and numbers.

Collections


Thumbnail highlighting collections sections.


When accessing, for example, data sent by the user, you will often use Request.Querystring or Request.Form. These are both commonly known as collections, and there are fair few of them at your disposal. This section lists those collections.

So now that you know what it does, please feel free to print out the ASP cheat sheet:

And finally, if you like the cheat sheets, and want to say thanks, I do have an Amazon Wishlist. Thankyou very much to those who have already hunted it down and sent me something nice - I'm very grateful!

Please note: If you wish to link to the ASP cheat sheet from elsewhere, please link to this page so others find the description, rather than linking directly to the sheet.
 

Syndication

If you like this post, subscribe to my full feed or partial feed.

 

27 comments (Add Yours)

You can keep up to date with this discussion by subscribing to the RSS or Atom feed.
 
James
United Kingdom #1: January 1, 2006
Well, I bumped into your website yesterday and I have to say: it's a real gem! I love these cheat sheets, they're a great help. All the best for the new year.
Thanks, James - and the same to you.
 United States #3: January 7, 2006
You spelled "Sheet" wrong in the title :-)
"Cheat Cheet" should be "Cheat <b>S</b>heet"

-Clint
Whoops! Thanks Clint, all fixed :)
Can you post the PDF please, I can't stand the blocky PNG print out. Thanks, great work.
Hagen
Indonesia #6: June 24, 2006
Great work on the cheat sheets! ^^,

I was wondering if you would be kind enough to do a VB.NET and C# cheat sheets? After all, web development is advancing and diversifying into many languages now.
 United Kingdom #7: July 11, 2006
Wow! Thanks, now I no longer need to rack my brains or hunt stuff down on the internet.

Brilliant!
I would like VB.NET and C# cheat sheets too! But thanks for ASP cheat sheet
The mode to append is 8 not 3 no? Good luck using it in an exam!
Thanks for sharing

*please ignore the url, 'cause i don't have one, i will someday, after learning stuffs from your page. thanks again.
sean
Singapore #11: December 14, 2006
it is very helpful.
how can i get hold of vb script to run ASP on my pc? I was told i need vb script ..is it correct? thks
Real Programmers
United States #12: February 3, 2007
Has anyone ever heard of asp.net and vb.net ????

Welcome to the 21st century.

Cheat-sheets should be available by 2009.
"Real Programmers", lol. How arrogant.

Using .NET for some sites is like using a steamroller to press a shirt. Wrong tool for the job. Sometimes regular old ASP is the best choice for a project.

I did consider doing a cheat sheet for it, but as everything you need is built in to Visual Studio, there doesn't seem to be much of a need. It's on the list of possibles though.
cindypsych
United States #14: March 6, 2007
You rock. I just found the answer to my question on this cheat sheet in 2 seconds. I have been looking at other websites, including Microsoft's, for over a half an hour. Thank you.
i want to use pulp up message box to display my message
@Real Programmers are you dumb for really. ASP should never skip our developer toolbox. you are stupid for real.
very nice Cheat Sheet
3xxx
Australia #17: September 15, 2007
I prefer small sample ,rather than cheat sheet (summary of syntax only)
learner
United States #18: September 20, 2007
Great to "see" an overview. Thanks.
umm This is is frggin awesome thank you ..:-)
Wake up: vb.net and asp.net are *FAR* better
than old technologies likes vb6 and asp.

When will YOU start using them? In 2011????
#20: VB.NET is what I work with at the moment and have done for the last couple of years. Do you think that me releasing a cheat sheet almost 2 years ago for a language I am familiar with implies a need to "wake up"?

I still maintain that regular old ASP can be more appropriate for some jobs and sites (especially for people who can't afford Visual Studio). There are people out there maintaining older sites built in ASP - for whom this cheat sheet would still be useful. And don't forget that VBScript is still used extensively in Microsoft products.

As I said above, I thought about doing a .NET cheat sheet, however all the documentation is built in to VS and intellisense removes the need for almost everything that would go on to a cheat sheet. I've had a go at putting one together, but haven't yet been able to make it useful without including stuff that's at your fingertips while developing in .NET anyway.
I found your fact-sheet while looking for asp+vbscript in google: you're number 1 from over 3 million results!

Unfortunately I never had the chance to use VB.NET professionally, the intellisense and context-sensitive help in Visual Studio is great (in VB6 too!) but I've recently changed my job and this new company uses classic ASP extensively. It's a small company and there doesn't seem much need of migration, so I guess ASP and VBScript will stick around for a while.

This cheat sheet you made some time ago will be put to good use by me (hey, I didn't even know regular expressions were possible!)

Thanks and good luck to you!
DOT NET
United Kingdom #23: January 22, 2008
When will i start using .Net...um...yeah...2011 should about cover it...FFS waken up...Every business process could be modelled in VB6+SQL2000, without exception...So why this forced upgrade?...Oh...Profit...yeah...Microsoft’s...So buy into it if you like...I suppose you swear by Vista too...DOH

PS. I'm an actively contracting Software Engineer / Solution Provider and I *never* use DOT NET. Ever. Oh, and I am able to work for 4 months, and take the year off:) Stick with DOT NET, sink with the rest of the sheep, or rats.
baliwebdesigner
Australia #24: February 18, 2008
classic asp still alive :) .NET? Sorry, i prefer migrate to PHP or Ruby.
 United States #25: March 22, 2008
Excellent refernce sheet - i don't have to search in google all the time. Great work
Mike
United States #26: April 18, 2008
I've found that a vbscript can do almost anything that any other programming language can do.

It is not clunky and can be done with a simple text editor.
Arctik
United Kingdom #27: April 21, 2008
Thanks a lot for this preciouuuuus Cheat sheet!
...it will for sure solve many of my on coming problems. ^^

 

Post Your Comment

 
Only the name and comment fields are required.
 

Live Comment Preview

 United States #28: 1 minute ago

Web Design, Development and Marketing