Computer Architects

Computer Architects

CK 2005/146020/23

<% '******************************************************* '* ASP 101 Sample Code - http://www.asp101.com/ * '* * '* This code is made available as a service to our * '* visitors and is provided strictly for the * '* purpose of illustration. * '* * '* http://www.asp101.com/samples/license.asp * '* * '* Please direct all inquiries to webmaster@asp101.com * '******************************************************* %> <%= RetrieveAndIncrementCount() %> <% ' I placed this in a function so I wouldn't have to worry about ' any namespace collisions. For example... if this was inline ' code and someone named a variable strSQL in a file this file ' gets included into you'd get an error. This way you don't and ' there's no chance of the variables overwriting one another! Function RetrieveAndIncrementCount() ' From adovbs.inc: Const adOpenKeyset = 1 Const adLockPessimistic = 2 Const adCmdText = &H0001 ' Local variables Dim strFilename Dim strSQL Dim rsCounter Dim iCount ' Get filename and build SQL query strFilename = Request.ServerVariables("SCRIPT_NAME") strSQL = "SELECT page_name, hit_count FROM hit_count WHERE page_name='" & strFilename & "';" ' Open our recordset Set rsCounter = Server.CreateObject("ADODB.Recordset") ' Access version: 'rsCounter.Open strSQL, _ ' "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("counter_db.mdb") & ";", _ ' adOpenKeyset, adLockPessimistic, adCmdText ' SQL Server version: rsCounter.Open strSQL, "Provider=SQLOLEDB;Data Source=10.2.1.214;" _ & "Initial Catalog=samples;User Id=samples;Password=password;" _ & "Connect Timeout=15;Network Library=dbmssocn;", _ adOpenKeyset, adLockPessimistic, adCmdText ' If we've got a record then we read the current value ' If we don't then we create one, set the filename, and start at 0 If rsCounter.EOF Then rsCounter.AddNew iCount = 0 rsCounter.Fields("page_name").Value = strFilename Else rsCounter.MoveFirst iCount = rsCounter.Fields("hit_count").Value End If ' Increment the count and update the DB rsCounter.Fields("hit_count").Value = iCount + 1 rsCounter.Update ' Close our connection rsCounter.Close Set rsCounter = Nothing ' Return the count (pre-incrementation). RetrieveAndIncrementCount = iCount End Function %>

Your Efficiency is MY Challenge!!

Supported Initiatives

Home

About Us

Contact Us

Service List

Disaster Recovery

Backups

Tape Backups

CD / DVD Backups

Disk Backups

On-Line Backups

Health Checks

SLA's

Policy Documents

Networks

Upgrades

SPECIALS!!

Internet Services

Project List

Promo Product List

Doctor Computer I presume?

Simple tasks to improve your computer performance

There are a multitude of tasks and program tools available to help keep your computer running at its optimum. However there are built in tools in Microsoft that can do the job just as well and they are “free”.

What causes your computer to run “slow”? The main reason for this is due to fragmented files on your hard disk. When files are being written to the hard drive, they are written to the first available free disk space, even if there is NOT enough space to write the complete file. The file is then fragmented into different pieces and the next available disk space is used, and so on until the complete file has been written. Operating systems are then very “clever” in that they keep a record of where the file is (its physical location on the hard drive, albeit in 30 or more different places) in what is called the FAT (File Allocation) Table. If this table is corrupted, you have basically had a hard drive crash!

One of the most commonly used and effective tools is then “Disk Defragmenter”. You may ask “surely Microsoft looks after fragmented files using NTFS?” Unfortunately you still get fragmented files and these need to be “fixed” on a regular basis. The more often you use this tool, the shorter the time it takes to complete the task. If you have a 40Gb hard drive and only have 2Gb of free disk space, the tool is going to take an exorbitant amount of time to complete.

Other reasons for a “slow” computer could be the number of open programs running. Make sure you do not have multiple copies of the same program open at the same time. This is very common especially with Microsoft Outlook. Another one to check is the number of program being loaded at time of boot up. See what program are loaded into memory by running your mouse pointer over the icons in the bottom RIGHT hand side of the computer screen. Close some or all by right-clicking the icon and select “exit / close / stop” etc.

Therefore regular checks are necessary. Ideally these check should be scheduled to run preferably during the evening or while you are at lunch. For home users it becomes a bit more difficult as they normally do not have their computer on permanently or only use it when they need to do something.

Please contact Computer Architects for assistance on setting up this option, or to come and do it for you.

· Do regular health checks.

· Use Disk Defragmenter from your “Accessories, System Tools” menu.

· The more often you do the check, the better your computer will run.

· Other tools include MS AntiSpyware.

· Beware of obscure Registry Tools, these can damage your computer.

Andy van Eyk

Mobile: 082-571-2751

Fax: 086-688-6827

E-mail: andy@comparch.co.za

To contact us:

Health Checks