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

Hello experts, I'm trying to develop a code that can manipulate the cursor to transfer from one input text to another. The big problem is that the input text that i have is in the table. The Table is made thru insertRow. Therfore, they are in the same id. So, I try to make an index to determine which of them is being click. I attached the code below to make you (experts) understand of what i am trying to do. Please help me achieve the goal if is possible. My goal is to let the cursor focus from one input text to another by using arrow-up, arrow-down, left and right. Thank you!

<!DOCTYPE html>
table,th,td {
  border : 1px solid black;
  border-collapse: collapse;
th,td {
  padding: 5px;
tfoot {color:red;}

<table id="Tab1">


<button onclick="return AddNow()">Add row</button>

function AddNow() {

  var p = parseInt("2.50");
  var table = document.getElementById("Tab1");
  var row = table.insertRow(table.rows.length);
  var cell1 = row.insertCell(0);
  var cell2 = row.insertCell(1);

  cell1.innerHTML = '<input type="text"  id="qty" class="Qty"  onkeydown="myIndex(this)"/>';
  cell2.innerHTML = '<input type="text" id="rp"  value="' + p + '"' + ' readonly/>'; 


function myIndex(x)
  var h = x.parentElement.parentElement.rowIndex; 
  // here focus() must transfer to the next row depending on the user choice 

Open in new window

Free Tool: Site Down Detector
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Hi experts, how to make codes that will give information of the browser, client side?

<!DOCTYPE html>

<button onclick="GetBrowserName()">Get Browser name</button>

function GetBrowserName() {
    alert("You're browser name is");


Open in new window

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.
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?
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

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

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!

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 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 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
Salesforce Has Never Been Easier
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now


I am hoping someone can help me with an issue I am having whilst using Jquery and Classic ASP.

This code works perfectly..

  <script type="text/javascript">

    $(document).ready(function() {


BUT as soon as I add in the code for my ajax form submit it does not work..

  <script type="text/javascript">
    $(document).ready(function() {
         $('#submitButton').click(function() {
            type: "POST",
            url: "test.asp",
            data:  $("#form1").serialize(),
            cache: false,
            dataType: "html",
            success: function(responseText){
            error: function(resposeText){

    return false;


I am trying to use classic ASP on IIS6 on Win7. I went to control panel->Programs->Tuen win features on or off->IIS->App Dev Features

After checking ASP/ASP.NET.....  I needed to reboot, but after rebooting, they were unchecked again.

any ideas?  thanks
Hello all;

I found the following
Which works rather well, but I seem to run into an issue, where not all the values get replaced.

   strText = Replace(strText, "REPLACE_Name", strName)
   strText = Replace(strText, "REPLACE_Email", strEmail)

Open in new window

So, if I change the top one, to another word here, and in the HTML Template.
It will not update, and change.

I have restarted IIS, to see if maybe there was an issue there.
And nothing.

Is there another way to do this, where I can change the template values with records from the database?
That will work better than this one?

By the way, the article in the link uses the old CDONTS

This is my Replace, that I am doing.
I have it marked on the ones that work and do not work.

Function ReadFile(filename)
  Dim objFSO
  Dim objTStream
  Dim strText
  Const ForReading = 1

  Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objTStream = objFSO.OpenTextFile(Server.MapPath(filename), ForReading)
      strText = objTStream.ReadAll
    Set objTStream = Nothing
  Set objFSO = Nothing
  strText = Replace(strText, "REPLACE_url", theurl) ' >>>>>>Dosn't Works
  strText = Replace(strText, "REPLACE_siteName", siteName) ' >>>>>>Dosn't Works
  strText = Replace(strText, "REPLACE_Welcome", theMessage) ' >>>>>>Dosn't Works
  strText = Replace(strText, 

Open in new window

In my classic ASP application I have to read a number from database and again write it to another table in the database.
when the number is larger than long, I converted it to number using csng function. But it has converted to scientific notation and the number has not been written to the database correctly.

correct number                              Incorrect number
101304333                                       101304300
101503485                                       101503500
1171100103                                     1171100100
When I disable TLS 1.0 my classic ASP application connection doesn't connect to my SQL 2014 server.  I can use the ODBC GUI to create the connection successfully but when using that DSN or specifying the connection properties in my ASP connection string it fails to connect.  I've enabled and installed all of the ASP.NET, SQL Native Client and ODBC updates to allow TLS 1.2 but it's still not working when I disable TLS 1.0.
Hello, I tried to ask this question earlier, but after bumping my head a few times with the responses I've decided to ask the question in a different way:

I'm looking for a variable length (dynamic length) jQuery/javascript currency mask. The mask needs to do the following:

  • Pre fill with a '$' (dollar sign) any other pre-filled values are welcomed (commas, decimal point etc.)
  • Only allow numeric input and or commas and a decimal point
  • allow for any size number (within reason: millions is probably as far as it will need to go), but not force a minimum size number. i.e: you can enter $1,000,000,000.00 or you can enter $1.00 anything in between
  • I need to be able to plug and play: if i need the js file, I can get that

I would prefer code examples or jfiddle examples if possible. I don't work with and or use jQuery / javascript regularly so retro-fitting code to do what I need it to do is probably going to take more time than I'm willing to invest. Please help.





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.