ASP - Learning by Example

Dr. Robert B. Mellor    See also .... DHTML XML ASP

Congratulations on finishing the course "ASP ñ learning by example". You may well be proud of yourself and asking, "where do I go from here". So here are a few pointers.

The first tip is that if you think you have really understood the book, then you can get a certificate from an approved college

1. The database problem.

Drop Access. You can use Access & ASP for a few limited cases, for example, an intranet in a small or medium sized firm. But Access has several drawbacks. For example, Access is an Office program. When filled with around 20 000 to 50 000 data field, it gets so slow that only max. 5 users can be in at any one time. It is not scalable, so this is not good if you want a storming e-commerce web site.

Instead of Access, use SQL Server Pack 7. Why (you may ask) was this not recommended from the start ? There are two answers. Firstly, the book has to do with ASP, not databases, and secondly cost. Access is a free part of MS Office, SQL will cost you serious money. How much ? Licence costs have a mystical way of not being very clear, so here is a small overview:







SQL SP7 Internet Connector


SQL Active Directory Services

Clear ? Of course not. If you have a server running IIS you need an IIS licence, an SQL SP7 licence, and an SQL Server 7 Internet Connector. This will cost you at least 1000 dollars. If you are running NT4 then (above the NT4 licence) you will only need an SQL Server Pack 7 licence (around 400 dollars). However, you may wish to run on Win2000 (which contains IIS for free), but then, in addition to SQL SP7, the version of IIS that comes with Win200 needs SQL Server Pack 7 Active Directory Services. In all cases you may need MS Active X Data Objects 2.1, so ask your local Microsoft Certified Solution Provider for a concrete offer for your case.

Connecting ASP to SQL databases is like with Access. In one unbroken line type:

strConnect = "Driver={SQL Server};Server=servernavn; UID=username;PWD=password"

2. The business layer (middleware) approach

You have already explored the limits of what ASP can do with databases. It is tough, you know that it is a strenuous exercise to get the whole benefit. So several lines of thought have converged on "middleware".

Middleware solves several problems:

  1. ASP files are the public domain. So it is risky letting ASP talk directly to your precious database. This is OK with intranet, but is too easy to hack in an Internet situation
  2. ASP cannot talk to databases very well, but Visual Basic is really excellent in doing that.
  3. ASP objects are checked by IIS ("does this object really have that property , hmmmÖ. Iíd better go and check, wonít take a moment ÖÖ."), and indeed early ASP Internet sites got a bad reputation for being slow (it is not too bad with intranet due to the faster connection). However, in Visual Basic, the relevant properties are defined and bundled with the object. IIS does not take the extra time to check.

Thus a 3-tiered system has evolved. ASP is never allowed to talk directly to the database. Instead, ASP talks to middleware modules which are written in Visual Basic. This solves any security problems. On top of that, the Visual Basic lets you manipulate the database much better (so you can get more out of it) and faster.

Why (you may ask again) was this not recommended from the start ? There are two answers. Firstly, the book has to do with ASP, not Visual Basic, and secondly, would you really have gone out and spent 2000 dollars on a Visual Studio Enterprise Edition (which includes Visual Basic 6 and Visual InterDev) ?

3. The vanishing milk problem

Imagine an Internet supermarket selling milk (amongst other things). Late in the day there are 10 cyber-shoppers in the store. Each puts milk into their cyber-shopping baskets. However, in reality, there is only one carton of milk left on the shelves, so when the first one gets to the cash-out, the milk in the other 9 shopping baskets simply disappears !

Everybody would like a lot of cyber-shoppers in their Internet store, so how do you keep a check on how much you have left ? If you check out as soon as stuff is put in a shopping basket, then youíll soon have empty shelves, but all your cyber-shoppers may simply have shut down their browsers, so youíve got no money either !

The best answer at the moment is MTS, Microsoft Transaction Server. Unfortunately this is not the right place to go into that, but if you want an e-commerce solution (or be an e-commerce programmer), then this is the kind of problem youíll have to address. Microsoft have been making big advances recently, with MS-Commerce Server, SQL2000 Server, and the new MS Content Management Server (but at over 30 000 dollars, you'd better wait for the price to drop).

4. Life after ASP

I hope you have got a few pointers as to what to do now. You need to look at transactions, you need to know more about databases, and, if you wish to continue in Microsoft services, then you need quite a bit of Visual Basic, the glue that holds it all together, as well as XML.

Good luck.

Return to overview