The ASCII table was created to correlate each Roman character to a number. It has subsequently been extended to given a wider range of characters. Classic ASP had two commands to convert to and from ASCII characters and their number representation: char and asc. To convert the integer value, intASCII to the string value strASCII: […]
Category: ASP
Operation Must use an Updateable Query
I get this error message when adding or modifying data Microsoft OLE DB Provider for ODBC Drivers error ‘80004005’ Database Error: [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query. This is a very common error message when updating Access databases. Since Access is file based any attempt to update the database by an ASP […]
Remove the HTML Tags From a String
A classic ASP function to remove the HTML tags from a given string. Function StripHTMLTags(ByVal sHTML) Dim objRegExp Dim sOutput sHTML = Trim(sHTML & “”) ‘Check to ensure that the string has length If Len(sHTML) > 0 Then Set objRegExp = New RegExp With objRegExp .IgnoreCase = True .Global = True .Pattern= “<[^>]+>” sOutput = […]
Removing Punctuation Marks From a String
Sometime ago I needed a function to remove the punctuation marks from a string in classic ASP. The function created passed in the string to have the punctuation removed. Using regular expressions the unwanted punctuation was then removed. The function removePunctuation used to remove punctuation marks: Function removePunctuation(str) Dim regEx Set regEx = New RegExp […]
Rename a File with FileSystemObject
In classic ASP the FileSystemObject doesn’t have a rename operation. A function is required to achieve the file renaming. I have used the following file renaming function before to rename files. The function moves the file from its old file name to its new file name. <% Sub FileRename(oldFileName, newFileName) Dim fso Set fso = […]
Writing Date and Time to a Page
ASP supports a number of commands deriving date and time information, from outputting the current date or time, or more specifically deriving, for example, the current year or even the name of the current month. The table below details some of these data time related commands. Command Description date() Output is like: 17/2/2003 (format of […]
Error Handling in Classic ASP
Classic ASP error handling is similar to that of VB.NET and C#. However, it looks more like has a more basic approach to error handling, it doesn’t support the try and catch error handling of VB.NET and C#. After everything else is done with your new piece of asp code, what about errors? No matter […]
If Then Else End If
The if then … else … end if statement is one of the core statements used in ASP. Using this statement we can test if a condition is met, then dependant upon the result follow one of two actions. As an example we will show a greeting on the page if its the morning. <% […]
Database Column Type Codes
The following code may be used to derive details about the name, value and type for each column in the current row of a database table. <% Dim objFields As ADODB.Fields Dim i As Integer objRs.Open strSQL, strConnStr, adOpenForwardOnly, adLockReadOnly, adCmdText Set objFields = objRS.Fields For Each fieldF in objRS.Fields fieldName = fieldF.Name fieldType = […]
URLEncoding a Query String
Adding database derived information to a querystring can lead to a badly formed URL which doesn’t translate the querystring parameters correctly. An example of a wrongly included character is the single apostrophe. To correct this, preventing a JavaScript error on the page, the data needs to be encoded with the server.urlencode( ) command. For example: […]


