Articles & Videos



Active Server Pages (ASP) is Microsoft’s first server-side engine for dynamic web pages. ASP’s support of the Component Object Model (COM) enables it to access and use compiled libraries such as DLLs. It has been superseded by ASP.NET, but will be supported by Internet Information Services (IIS) through at least 2022.

Share tech news, updates, or what's on your mind.

Sign up to Post

This question is a follow-up to this (solved) one :

My goal was to be able to update records in a Classic ASP application, and that part is fine. The last step in my code is a Response.Redirect statement, which reloads the page after the update. This is fine, but as the form spans more than one page, after the update the user is not returned to the exact point in the page (has to scroll to get to the exact record again).

I looked at the code provided by Wayne Barron ( [*excellent tutorial, btw - thanks!*], and I tried adding an anchor, but this only takes the user back to the top of the form, not to exact point where he left off, after clicking the "Save" button.

As each row of the form has a unique ID (getConID above), I tried using this also, in the redirect statement, but it did not work.

This is the code I use to update a record in the form :

'updateform.asp v03 22-06-2017
getConID = request.form("ID")   'this is the unique row identifier
getCom = request.form("Comment")
getSchoolID = request.form("SchoolID")
' Now update the live TblReportsStoreComments table

Set sqlProp=Server.CreateObject("ADODB.Command")

sqlProp.commandtext="UPDATE TblReportsStoreComments SET txtComment=? where TblReportsStoreCommentsID=? "

Open in new window

Free Tool: Subnet Calculator
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Hello there I have looked through the interweb and cannot seem to find anything except TRIM to remove spaces.

Unfortunately Trim remove pre and post spaces, which I do not require

I was to remove the spaces within a field

eg. Te Awe Awe Gardner --> TeAweAweGardner

Any help would be great
Hi Experts,

I am trying to update legacy ASP code amd I am starting out with
<%@ Language=VBScript %>

Session("isLocal") = True

Session("getRates") = ""
Session("getRatesTime") = DateAdd("n", -1, Now())	'DateAdd Intervals: s=secs; n=minutes; h=hrs

Session("Root") = "../"
Session("sourceID") = 1

If (Session("isLocal") = True) Then   

    <!--  <!-- #include file = "../../CSSN_subdomains/includes/common.asp" -->
    <!--  <!-- #include file = "../../CSSN_subdomains/includes/functions.asp" -->
    <!--  <!-- #include file = "../../CSSN_subdomains/includes/PageSetup.asp" -->


    <!--  <!-- #include virtual = "/includes/common.asp" -->
    <!--  <!-- #include virtual = "/includes/functions.asp" -->
    <!--  <!-- #include virtual = "/includes/PageSetup.asp" -->

End If

Open in new window

However, I am getting the following error despite that Session("isLocal") is True, so lines 23-25 should never be executed.
Active Server Pages error 'ASP 0126'

Include file not found

/CSST_subdomains/, line 23

The include file '/includes/common.asp' was not found.

Open in new window

What is going on?

Any help will be greatly appreciated.
I have  sun server that runs a local application that uses the following ports: JMS 5630, XML 9672,
ASP Http 80 and ASP https 443, i can only telnet to port 80, telneting to the other ports I get
unable to connect to remote host: connection refused. I checked the /etc/services and I do not see the ports listed.
BTW: This application used to work without problems...

We've got a few old customers that, believe it or not, still have old classic ASP sites.   We recently began to migrate them from SQL 2012 to Azure SQL Database.  After the database migration, we get the following errors on the sites:

Server Native Client 11.0][SQL Server]The request for procedure '[tablename]' failed because '[tablename]' is a table object.

I figure at this point there has to be a fix for this however I cannot seem to locate it.

Anyone have the magic bullet?
<form method="post" action="contact.asp">
                        <b>Envíenos un mensaje</b> <span></span>
                        <input type="text" name="fname" id="fname" value="Nombre">
                        <input type="text" name="email" id="email" value="Dirección de Email">
                        <select name="Consultorio">
                            <option>Elija Consultorio...</option>
                            <option>San Miguel</option>
                        <textarea name="message" id="message" cols="30" rows="10">Escriba aquí su mensaje...</textarea>
                        <input type="submit"  name="send" id="send" value="Enviar Mensaje">

how do i set a input name in the select in order to asp read the select option?
Hi experts, I need to upgrade high version of excel to export html table to excel. The codes below are able to export from table to excel, How can i upgrade it to high version of excel with an extension .xlsx  ? any help please!

<!DOCTYPE html>
		<title>jQuery Boilerplate</title>
		<script src=""></script>
		<script src="dist/jquery.table2excel.min.js"></script>
    <button class="WinExcel">Export</button>
        <table class="Stocks32">
            <td>Erwin M. Malalis 500</td>
	$(function() {
				exclude: ".noExl",
				name: "Excel Document Name",
				filename: "Prolist",
				//fileext: ".xls",
				exclude_img: true,
				exclude_links: true,
				exclude_inputs: true

Open in new window

!function(a,b,c,d){function e(b,c){this.element=b,this.settings=a.extend({},k,c),this._defaults=k,this._name=j,this.init()}function f(a){return a.filename?a.filename:"Stocks32"}function g(a){var b=/(\s+alt\s*=\s*"([^"]*)"|\s+alt\s*=\s*'([^']*)')/i;return a.replace(/<img[^>]*>/gi,function(a){var c=b.exec(a);return null!==c&&c.length>=2?c[2]:""})}function h(a){return a.replace(/<a[^>]*>|<\/a>/gi,"")}function i(a){var b=/(\s+value\s*=\s*"([^"]*)"|\s+value\s*=\s*'([^']*)')/i;return 

Open in new window

After this code runs and adds a record to the recordset, I am unable to add any more entries into the record. I believe the record is getting locked by the database since it detected changes, but I'm not sure how to remove that through access. I have verified this code works properly besides the unintended side effect of being unable to repeatedly do it. Does anyone know how to unlock the record so everyone can access it after this runs?

    Set ClientRS = CurrentDb.OpenRecordset("Client Contacts", dbOpenDynaset, dbSeeChanges)
    With ClientRS
        ![id] = ClientID
        ![Full Name] = FullName
        ![Phone Number] = PhoneNumber.Value
        ![Company] = "Other"
    End With

    Set ClientRS = Nothing
    DoCmd.Close acForm, "Add Phone Record", acSavePrompt
End Sub
Hi experts, I wish to add 1 day on the edate I have coded below. Something like this (edate + 1). can i do this? Thanks!

Set rs = cn.Execute("Select Proname, REMARK, TheDate, INPro, OUTPro, BALANCE from Stock where PROCODE='" & code & "' And TheDate Between '" & sdate & "' And '" & edate & "' Order by icount")
Is this even possible?

I have select dropdown A containing - among other things - value x.
I have text input field B which is empty by default.

Now, if x in A is selected I want to check if B has a value. In a perfect scenario I would also want to check if B has a specific value.

Possible? If so - how? I can do the basic validate form stuff, but this turns into a if/and/then scenario that I'm unfamiliar with.

Best regards
Technology Partners: We Want Your Opinion!
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

I want to create a new asp website with the following tasks: login, signup, and view products after login, the site connect to MSSQL database
and I have to build a mobile application using wml and wmlscript.

I've done this task but I've made my pages mixed (all pages with asp extension have the wml and vb code)
now I should separate the code and publish my asp website and design an android application that connect to this site.

P.S it is a homework, and I should design two mobile applications(one using wml and the other using andriod eclips)

can someone advise me how to separate asp files, I suppose these asp pages should return JSON object  but how I will handle it in wml code,
in the another application I will handle it using java

any hint will help me


We have a login page that saves a cookie so that the username is stored and shows next time the user logs in.
We ran a security scan and got the following alert:

"Cookie without 'httpOnly" flag

Below is the code for setting up the cookie. How can we resolve the issue of the alert?

        function createCookie(name, value, days) {
            if (days) {
                var date = new Date();
                date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
                var expires = "; expires=" + date.toGMTString();
            else var expires = "";
            document.cookie = name + "=" + value + expires + "; path=/";

        function eraseCookie(name) {
            createCookie(name, "", -1);

Open in new window

The title pretty much says it all.  I created my array as follows:

' Multidimensional Array
	' arrTransactions(col,row)
	ReDim arrTransactions(6,0) 

	' SQL Statement
	strSQLStatement = 	"SELECT transactionNumber, jobNumber, eventName, collateralID, arrivalDate, returnDate, quantity " & _  
						"FROM collateralOut " & _
						"WHERE collateralID  ='" & strCollateralID & "' " & _
						"ORDER BY arrivalDate DESC" 

	' Connection
	Set conn = Server.CreateObject("ADODB.Connection") connectionStr

	' Create our recordset
	set strFilename=Server.CreateObject("ADODB.recordset")
	strFilename.Open strSQLStatement, conn

	If Not strFilename.EOF Then
		noRecord = "False"
		i = 0

		While Not strFilename.EOF

			arrTransactions(0,i) = strFilename.Fields("transactionNumber").Value
			arrTransactions(1,i) = strFilename.Fields("jobNumber").Value
			arrTransactions(2,i) = strFilename.Fields("eventName").Value
			arrTransactions(3,i) = strFilename.Fields("collateralID").Value
			arrTransactions(4,i) = strFilename.Fields("arrivalDate").Value
			arrTransactions(5,i) = strFilename.Fields("returnDate").Value
			arrTransactions(6,i) = strFilename.Fields("quantity").Value

			' Counter
			i = i + 1
			' Preserve array position
			ReDim Preserve arrTransactions(6,i)

			' Move to the next record
		noRecord = "True"
	End If
	' Close our connection
	Set strFilename = Nothing

Open in new window

Then I wrote the following to loop through the array but it's not working:
                 <table border="1" cellpadding="5" cellspacing="1" width="80%">
                    	<td bgcolor="#eeeff0"><strong>Trans#</strong></td>
                        <td bgcolor="#eeeff0"><strong>Event Name</strong></td>
                        <td bgcolor="#eeeff0"><strong>Event Start</strong></td>
                        <td bgcolor="#eeeff0"><strong>Qty Ordered</strong></td>
						If NoRecord = "False" Then
							For i=0 to (UBOUND(arrTransactions) - 1)
                    	<td valign="top"><%= arrTransactions(0,i) %></td>
                  		<td><%= HTMLDecode(arrTransactions(2,i) ) %></td>
                        <td valign="top"><%= arrTransactions(4,i) %></td>
                        <td valign="top" align="center"><%= arrTransactions(6,i) %></td>	
                    	<td colspan="5"><strong>No Records Found</strong></td>
					End If 

Open in new window

When I load the page it only loads 6 records and stops.  There are about 30 records the page should be displaying.  

I have a feeling that this line here is wrong...

For i=0 to (UBOUND(arrTransactions) - 1)

Open in new window

... but I'm not sure how to fix it.  Can someone please help me?
I think I know the answer to my question but I am asking it anyway (I know one is file  - xdDoc.Load and one is string xdDoc.LoadXml etc)
I have a variable that contains an XML formatted string.
Normally I would load XML from a file, using the following code:
	set xdDoc = Server.CreateObject("MSXML2.DOMDocument.6.0")

Open in new window

But the foregoing code fails when I use a XML string.
The following code works for the XML string and why is that??
AM I using the correct version for "Microsoft.XMLDOM"
I know I am okay with "MSXML2.DOMDocument.6.0"

   set xdDoc = CreateObject("Microsoft.XMLDOM") 

Open in new window

I am using a modified HTML form provided by Insightly on a website to capture data, do a Google reCAPTCHA verification, and then POST the data to Insightly. All of the text data is posting correctly, but the checkboxes are not. I am doing this with Classic ASP. The script which sends the data looks like this:

<%	set objXML=server.createobject("MSXML2.ServerXMLHTTP")

	objXML.Open "POST", "", False
	objXML.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
	objXML.Send data

	response.write(objXML.responseText) %>

Open in new window

The HTML checkboxes (as provided by Insightly) look like this:

<label for="insightly_LEAD_FIELD_23">St. Mary's </label><input id="insightly_LEAD_FIELD_23" name="LEAD_FIELD_23" type="checkbox" />

Open in new window

I am capturing the user's input and attempting to post the result to Insightly, however the checkbox data is not passing through. There is no "value" attribute in the checkbox, so I'm not sure what to send.

The value of the "data" variable in the first bit of code above looks like this:


I have also tried a variable on that data, which also does not work, like this:


The variables generally ARE working, such as FirstName, LastNAme, email, etc. Its the LEAD_FIELD_XX fields which I am not able to populate correctly.

Any idea what I could be doing wrong? Thanks!

I have this webdatabase made in classic asp/VBscript, and when a specific page is loaded into an iframe, I want to refresh the parent page after some SQL-codes has been executed. Why? Because the SQL update info on the parent page.
How can I do that built into the SQL precedure?? Is there a VBscript that can do the job? I know there's javascripts, but as far as I know I can't mix that up with the asp/VBscript.
I hope there's a solution out there. :-)

Best regards

Hi Expert,

In a ASP page this is normally not a problem but jquery mobile seems to make this a little harder.
I'd like to load a popup from a jquery mobile page and fill in a form, submit it, store my value into a DB (left out in my example file) and then close the popup and refresh the initial index.html page.  

<meta charset="utf-8">
<meta http-equiv="Cache-Control" content="no-store" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../css/themes/default/">
<script src="../js/jquery/jquery.js"></script>
<script src="../_assets/js/index.js"></script>
<script src="../js/jquery/"></script>
<div data-role="main" id="ui-content" class="ui-content">
<a href="#popupnieuw" data-rel="popup" data-position-to="window" data-transition="pop"  data-mini="true" data-inline="true" data-theme="b" data-corners="true" data-shadow="true" data-wrapperels="span" class="ui-btn ui-btn-inline ui-icon-plus ui-btn-icon-left">Een onderwijs behoefte toevoegen</a>
<div data-role="popup" data-history="false" id="popupnieuw" data-dismissible="false" data-overlay-theme="b" data-theme="a" data-corners="false" data-tolerance="15,15">
<div data-role="header" data-theme="a">
<a href="#" data-rel="back" data-role="button" data-theme="a" data-icon="delete" data-iconpos="notext" data-position-to="window" class="ui-btn-right">Close</a>
<h1>Een nieue wens</h1>

Open in new window


I have been getting the following error when using trying to upload an image:

Server side error
@Big Monty suggested the following:

1:objUpload = Server.CreateObject("Persits.Upload.1")
2:someFormValue = objUpload.Form("someValue")

Which I have done - now I do not get the error but my values come through as blank..

see my code:

'start the file upload 

strDISKLOCATION  = "\\FFtilsmb4012\Apps$\FORSALE\Uploaded_Images"
	<!-- #include file="../../upload/upload.asp" -->
	<%'Create the FileUploader
	Dim Uploader, File, ErrMsg
	Set Uploader = New FileUploader
	' This starts the upload process


	if varQuery="ForSale" then
	elseif varQuery="Wanted" then
	end if

varUserID = Request.ServerVariables("auth_user")

'Retreive the form variables

varTimeStamp = now()
varDate_Expire = DateAdd("d",31,varTimeStamp)

	 dim oRS2339
     Set oRS2339=server.createobject("ADODB.recordset") "FS_HDR", "dsn=FORSALE;uid=web_Admin;pwd=F1nnforest",1,3

Open in new window

I am getting the following error after completing the form on a contact us web page. This is the error:

ADODB.Fields error '800a0ea5'
Fields update failed. For further information, examine the Status property of individual field objects.
/contactus2.asp, line 33

The email account is on the same server as the webpage and requires authentication. The website was built in asp.

This is the script giving the error:

      'Get Form Variables
customername = Trim(Request.Form("customername"))
email = Trim(Request.Form("email"))
messagetext = Trim(Request.Form("messagetext"))

      'Create and Send E-Mail
Dim objCDOSYSCon
      'Create the e-mail server object
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
      'Out going SMTP server

objCDOSYSCon.Fields("") = ""
objCDOSYSCon.Fields("") = 25
objCDOSYSCon.Fields("") = 2
objCDOSYSCon.Fields("") = 60
objCDOSYSCon.Fields("") = ""
objCDOSYSCon.Fields("") = “**********”
Creating Instructional Tutorials  
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Hello All;

OK, this is code that I found a while back, and posted here.
ASP Classic - Insert text, Line breaks and Code

The issue that I had, or am still having now, is that I am giving the user the option to choose the tags they want to use.
They can have as many tags as they need in their post.

The issue with the code in the link above is that it will only do one tag hard coded.
So, that I have done is added an REGGEX into it, and it works GREAT! for the highlighting,
However, adding this in, has messed up the main function of this code FUNCTION, and that is.
It adds the line breaks to everything OUTSIDE of the Code tags.

The REGGEX that I used and works is this.

Function Reggex(strString, strPattern, strReplace)

	Dim RE: Set RE = New RegExp

	With RE
		.Pattern = strPattern
		.Global = True
		.IgnoreCase = True
		Reggex = .Replace(strString, strReplace)
	End With
End Function

fString =   Reggex(fString, "\[code=(.*?)\](.*?)\[\/code=(.*?)\]", "<pre class=""line-numbers"" id=""code""><code class=""language-$1 demo"">$2</code></pre id=""code"">")

Open in new window

The original code is this. (Modified to work in my project)

 	CodeTags(1,1,1) = "[ code=sql]" ' Remove the space between the bracket, 
 	CodeTags(1,2,1) = "[/ code=sql]" ' Remove the space between the bracket, 
 	CodeTags(1,1,2) = "<pre class=""line-numbers"" id=""code""><code class=""language-sql demo"">"
 	CodeTags(1,2,2) = "</code></pre id=""code"">"

Open in new window

This is the entire script.

Open in new window

I have a Windows 2012R2 server. I ran a PCI scan and the only vulnerability I found was " The Web server can be triggered to reveal the absolute path for the Web root directory and/or other software installed on the host"

The application we host requires parent paths to be enabled in IIS. I am not sure if this is causing the issue and if it is then what needs to be done with the application in order to be able to disable parent paths.

How can I resolve this issue?

I have to relaunch a classic asp site we built a few years ago. The following is the script I used that worked before, I am nor sure why it now only works for a small file, when the file is larger, I am getting "this page cannot be displayed"error. This script is to let user download the file that just created. When I received the error, the file was generated on the server.  thanks

<%'Option Explicit%>
If session.sessionid <> application(session("appvariable")) then 
	Response.Redirect "login.asp"
end if	
<%Response.Buffer = true%>
On Error Resume Next
Dim strPath
strPath = CStr(Request.QueryString("file"))

on error resume next
	if (request.querystring("EXCELZIPALL")=1) then
		filePath= Server.mapPath("../EXCELReports/EXCELBatchList") & "\"&replace(trim(SESSION("Companyname")),"@","-") & "-" & trim(SESSION("UserName"))
		filePath= Server.mapPath("../EXCELReports")
    end if
if err.number<>0 then
	response.write err.description
end if

'-- do some basic error checking for the QueryString
If strPath = "" Then
  Response.Write("No file specified.")
ElseIf InStr(strPath, "..") > 0 Then
  Response.Write("Illegal folder location.")
ElseIf Len(strPath) > 1024 Then
  Response.Write("Folder path too long.")
  Call DownloadFile(strPath)
End If
Private Sub DownloadFile(file)

Open in new window

I'm trying to figure out how to merge for example 4 x 2 .JPGs into one .JPG for use on a website automatically.
I use ASP and VB on my server. Any input would be very nice. I know how to do this in a table, but it will not work in my solution as it is a Flash based slider. Thanks in advance.
I need to convert seconds, out to the thousandths, to format.  I have a script that comes close but I believe it chops off the decimal seconds.  Can someone give me an alternative or show how to modify this one pleaes?

Function SecondsToTime(ByVal sglScnds)
  Dim hours, minutes, seconds

  ' calculates whole hours (like a div operator)
  hours = sglScnds \ 3600

  ' calculates the remaining number of seconds
  intSeconds = sglScnds Mod 3600

  ' calculates the whole number of minutes in the remaining number of seconds
  minutes = sglScnds \ 60

  ' calculates the remaining number of seconds after taking the number of minutes
  seconds = sglScnds Mod 60

  ' returns as a string
  SecondsToTime = hours & ":" & minutes & ":" & seconds
End Function

Open in new window

Thank You!
I have a looping  array that outputs all necessary data from table . I need to take that looped array and output it in a single string that I can use later in some other code .

Set Products_cmd = Server.CreateObject ("ADODB.Command")
Products_cmd.ActiveConnection = dbHistory
Products_cmd.CommandText = "SELECT * FROM organic WHERE isActive=0" 
Products_cmd.Prepared = true

Set Products = Products_cmd.Execute

Dim arrProducts
arrProducts = Products.GetRows()

dim i
For i = 0 to ubound(arrProducts, 2)
   response.write( trim(arrProducts(1,i))+"," )


Open in new window

Thanks in advance





Articles & Videos



Active Server Pages (ASP) is Microsoft’s first server-side engine for dynamic web pages. ASP’s support of the Component Object Model (COM) enables it to access and use compiled libraries such as DLLs. It has been superseded by ASP.NET, but will be supported by Internet Information Services (IIS) through at least 2022.