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, All.

In my access database column, I have the following string of numbers and characters.

The column (CASTID) has the following

Open in new window

I have a code to use in ASP, but what I need now, is a query within access to get the number.

So, in this case, we are needing only 2011
And looking at the string, we have two 2011's
A single 2011
And at the end, 20119

We only want, returned what is searched for.
So in this case, the only record(s) we need returned is 2011.

Is I do a search with like
FROM Media
WHERE CastID Like "*2011*"

Open in new window

It returns all the numbers in the row but also finds records that do not have the number associated with it.

JavaScript Best Practices
LVL 13
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

Hello, All.

working on the last part of this project.
At least for the math anyway.

I have all my time in the database set as minutes.
90 = 1:30:00
So, what I need to do now, is convert the minutes into seconds.
90 = 5400

Everything I am finding is for the reverse.
Seconds into Minutes or hours.
Nothing for the opposite.

Any idea's on this one?
Hello, All.

I need to subtract time.
My output is the following format.

Time of Video = 01:30:00
Time played    = 00:07:17

I tried the accepted code from this post here. VBScript Time difference

I THINK I am using it correctly.
So, I tried the following.

theMTS = "00:07:17"
TTime = "01:30:00"


Open in new window

Output SHOULD be: 01:22:43

I get the following error.

Microsoft VBScript runtime error '800a000d'
Type mismatch: 'Cint'
/media/test2.asp, line 96

This is the line 96
BegTime = Cint(iStart)

Here is the code from the above-mentioned page.

Function SubtractTimes(iStart, iEnd)
' Given the following input values...
'    @TimBeg = 0815
'    @TimEnd = 1000
' the result should be 0145

Dim BegTime  ' Beginning time converted to an integer
Dim EndTime  ' Ending    time converted to an integer
Dim BH       ' Beginning hour converted to minutes since midnight
Dim BM       ' Beginning mins
Dim BT       ' Beginning time in minutes since midnight
Dim EH       ' Ending hour converted to minutes since midnight
Dim EM       ' Ending mins
Dim ET       ' Ending time in minutes since midnight
Dim TM       ' Total minutes in interval
Dim IH       ' Interval hours
Dim IM       ' Interval mins
Dim IT       ' 

Open in new window

Hello, All.
(For reference, I will be using ASP Classic in this project, however. That should not matter on how you submit the form to the data side.)

I am using HTML5 Video on my site.
I would like to capture the time the video stops at, and save it to my database.
(The database work I have completed)
What I need to know, is how to save the form, when the video is stopped?

here is a link to the video test page.

Here are the video and form code.
<video width="100%" height="100%" autobuffer controls id="myvideo" src="" type="video/mp4">
<form name="displayurl" action="data/NewInsert.asp" method="post" onsubmit="xmlhttpPost('data/NewInsert.asp', 'displayurl', 'MotionDiv', '<img src=\'graph/pleasewait.gif\'>'); return false;">
        <input name="offseturl" type="text" readonly="" value="" size="50" onclick="document.displayurl.offseturl.focus();;"/>
        <input type="hidden" name="Submit" value="Send Video Time" />
        <input type="hidden" name="UID" value="2" />
        <input type="hidden" name="MediaID" value="1" />
      <div id="MotionDiv"></div>

Open in new window

On this page, you can view the source.
I added a hidden button to get me a "Name" and "value" to call in the code for inserting the data into the database.

Any assistance on this would be great.
Hello, All.
(ASP Classic / Access Database)

OK, I am working on a project for our family home use.
In this project, I am using an Access Database.
(This makes it easier if I port it over to someone else's computer if they would like to use it.)

The column (CASTID) has the following

Open in new window

OK, let's say you only wanted to return the value for
How would you ask that in Access, that will work in ASP Classic?

I asked a similar question over here.
However, it is for SQL Server.

I tried the code from netminder, and I am uncertain about how to get it to work with my current project.

Hi there.

I have this table where I want to hide specific rows until a specific value is chosen from a Select-panel.
I can hide a textbox or other elements, but my code doesn't work for a table row. Any idea why?
Here's the Javascript:
<script type="text/javascript">
function Check() {
   if (document.getElementById('mm_comor_infectious_choice').value == "Yes") {
        document.getElementById('a1').style.display = 'block';
    else {
        document.getElementById('a1').style.display = 'none';



Open in new window

Here's the div-tags I "wrap" around the <tr></tr> in a table to hide it all until "Yes" is selected from the dropdown menu below:
<div id="a1" style="display:none" >

Open in new window

<select name="mm_comor_infectious_choice" id="mm_comor_infectious_choice" onchange="Check();">
        <option value="na" selected="selected"></option>
        <option value="Yes">Yes</option>
        <option value="No">No</option>

Open in new window

What's the trick to make it work? As mentioned: If I wrap a single element with the div-tags, then it works fine.

Best regards

We currently use ASPUpload and DropZonejs  to drag and drop files and then upload them to our server.

We are looking for a compatible script that will ZIP (compress) the files after the user drags and drops them in the "DropZone", and create one zip file which is the one that would be uploaded using ASPUpload.
Any recommendations on a script that would do this?

We need this for ASP Classic and also for NetCore.
javascript error
Not sure if I'm just being silly, but can't seem to get this script to work

function GetIP()
    var strIP
      strIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR");
    If strIP = "" Then strIP = Request.ServerVariables("REMOTE_ADDR");
    IP = strIP;
      document.form1.User_IP.value = IP;

My predecessor programmed our Intranet using ASP ages ago. There's code on a form submittal where it's using an Update statement to take away from the number showing in the database:

myConnString = Application("Flash_ConnectionString")	
Set myConnection = Server.CreateObject("ADODB.Connection")
myConnection.Open myConnString
mySql="UPDATE OnHand SET ohnum = ohnum - 1 WHERE ohnum > 0"
myConnection.Execute mySQL
Set myConnection = Nothing

Open in new window

This works fine but we have since changed things to where the form allows the person to put any number for this item that we still need to subtract from the DB.

To make things easier, I call the value from the form and assign it to the variable s16: s16 = Request.Form("size16")

Then I try to get the Update statement to use my s16 var rather than the static number (mySql="UPDATE OnHand SET ohnum = ohnum - s16 WHERE ohnum > 0") and the web page returns this error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'

[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

/flash/Confirm.asp, line 233

Open in new window

Some things I do know:
1. Both ohnum and size16 are a Number data type in the Access DB
2. Via a Response.Write Command, I verified that the variable s16 does carry the correct information.

It's probably some kind of text/number mismatch but I cant seem to figure it out.

I have zero training with ASP so be gentle :)
Experts - Can someone give me code samples for Classic asp with EWS connection please?

Classic asp and not .Net
Angular Fundamentals
LVL 13
Angular Fundamentals

Learn the fundamentals of Angular 2, a JavaScript framework for developing dynamic single page applications.

I use the following asp net email validator and it works fine until today I get an email (
And I want to ensure to accept this string '--'.

how can I do that with my current email validator?

<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
            ControlToValidate="NewEmailAddressTextBox" CssClass="red bold"
            Display="Dynamic" ErrorMessage="*"
I am trying to create 2 web pages using Classic ASP. I know it's outdated now, but I used to write in it many years ago, and have mostly forgotten it all. It's just for a way of displaying all of the video files I have for each tape. So one tape (tbl_tape) will have many video file (tbl_video_file), linked by tape_id - fk_tape.

Page 1 - (list_tapes.asp) just needs to create a dropdown populated from tbl_tape. I am familiar with how to do this part, so you can skip all of the table set up and SQL statements. This will produce a field called "tape_id". But I can't work out how to retrieve this value from the dropdown.
Then ideally, each item in the dropdown is a hyperlink to the next page, which is passed the tape_id. So you press the relevant tape ID in the dropdown and it then goes to Page 2. So from memory, it will need a hyperlink of "list_files.asp?file_id = 3"

Page 2 - (list_files.asp) just need to list all of the video files for the value of tape_id sent from Page 1. Again I can do all of the SQL side of this, I just need to know how Page 2 references the value sent to it, which will be fk_tape
I am trying to utilize this piece of classic asp code and am getting errors:
<a href='javascript:delay(Update.asp?c=" & request.QueryString("c") & "&g=" & request.QueryString("g") & "')>

Open in new window

I only get errors when request.QueryString("g") contains a space:

Invalid left-hand side in assignment

Below is the function:
	function delay (URL) {
	setTimeout( function() { window.location = URL }, 500 );

Open in new window

I'd like to remove quotation marks from the "username" field before it is submitted.
Can this be done with JavaScript ?
I have a simple stored procedure which generates insert statements, and I want to know how to execute them automatically.

I am calling this stored procedure from a button on a Classic ASP page., which is the reason for wanting the INSERT statements to be executed after they are created.

In its simplest form,  here is the statement that generates the INSERT statements :

SELECT 'INSERT INTO DEV_Test (''' + txtSchoolID + ''', '''', '''', '''', '''' )' FROM DEV_Test2

Open in new window

… and this is what is produced :

INSERT INTO DEV_Test ('150721346050', '', '', '', '' )
INSERT INTO DEV_Test ('3456407213', '', '', '', '' )
INSERT INTO DEV_Test ('3721313250', '', '', '', '' )
INSERT INTO DEV_Test ('3721388839', '', '', '', '' )

Open in new window

… and I want the stored procedure to execute these statements.

Can anyone help?

Thank you

I installed parallels in a MacOS and then installed Windows 10.
We run a simple ClassicASP Application on the local IIS for development purposes.  It uses a few third party plugins.

We have the exact same configuration on another computer and it works just fine there, but on this install of Windows 10 when we try to use any of the plugins I get the following error:

Microsoft VBScript runtime error '800a01ad'

ActiveX component can't create object: 

Open in new window

I am trying to work with Thread.CurrentPrincipal and need some help with that. Never used that before so any help will be helpful.

this is what i have so far.

            interface IAmSomething
                  bool something(string role);

public async Task<IActionResult> Index()

var haveRole= Thread.CurrentPrincipal as IAmSomething;

if (haveRole.something("some_string_value"))

I just need to test for now by hardcoding some values so what should i do in order for the if statement to work. as expected if statement is throwing a null exception .
Hi all, I am lost to how to make this work... or to describe it

the code:
Set PackageOption=oConn.Execute("SELECT * FROM enq_items WHERE land_ID=1251 AND item_type=35")
<td width=10% align=center rowspan=2><input type=hidden name=itemID value=5280><select name=packageID>
Do Until PackageOption.EOF
</select><br><input type=submit name=package value='Add'></td>

Open in new window

Submit Code:
oConn.Execute("UPDATE enq_items SET item_package="&Request.Form("packageID")&" WHERE item_ID="&Request.Form("itemID"))

Open in new window

UPDATE enq_items SET item_package=5434, 5434, 5434, 5434, 5434, 5434, 5434, 5434 WHERE item_ID=5280, 5279, 5281, 5283, 5282, 5284, 5289, 5285
Microsoft JET Database Engine error '80040e14'

Syntax error in UPDATE statement.

/process.asp, line 955

Open in new window

As you can see its grabbing multiple packageIDs & itemIDs, how do i get it to grab just 1 of each?
This is not really a problem - yet. It is merely me trying to understand how to secure my code from sql injection. I'm using classic asp as it's all I know.

As far as I understand using stored procedures within my mysql database and then  calling these procedures would be the way forward. I'd like to get this working.
I was directed towards this web-page in an earlier question:

However this concerns an MS access database, and I can't get it to work in my mysql database (for obvious reasons I guess).

Let's assume that I have table MyTable with the followong fields: Id (mediumint), GUID (varchar), Name (Text), DateInserted (Datetime), Comments (Text) (DateTime), Status (mediumint)

I need to read from, update, insert and delete in this table.
I would need to create stored procedures for this, right? I can't seem to find a way to do that using phpMydAdmin (which is what I got and will use, regardless). How would I create these procedures?

Remember that this has to work with classic asp.
Best regards
CompTIA Network+
LVL 13
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

I'm using web forms and visual basic.

On my page i have a ASP Textbox.

I'm using the TextChanged event.

This is my code:

    Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As EventArgs)

        HiddenField_TextBox1Changed.Value = TextBox1.Text

    End Sub

So when I type some text in the textbox, the textchanged event is saving the value I typed in the textbox, to a hidden field.

What's the equivalent to the TextChanged event of a textbox using JavaScript instead of Visual Basic?
Hi everyone!

At my wits end here. I have this code:
Dim UserIPAddress
UserIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If UserIPAddress = "" Then
  UserIPAddress = Request.ServerVariables("REMOTE_ADDR")
End If

  userNow = Session("Bruger")
  SQLStr = "SELECT * FROM USERDATABASE WHERE Bruger = '" &  userNow & "'"
  Set RSDatabase = DATABASE.Execute(SQLStr)
  UserId =  RSDatabase("UserId")
  Admin =  RSDatabase("Navn")

GUID = Request.querystring("GUID")

   '*** Find brugernavn & adgangskode
    SQLmaal = _
     " SELECT "				&_
	"  *     "			&_
	" FROM   "			&_
	"  DATABASE "			&_
"  WHERE "			&_
"  GUID = " & GUID & "  "	

   Set RSDatabase = DATABASE.Execute(SQLmaal)

   GUID = RSDatabase("GUID")
id = RSDatabase("Id")
   navn = RSDatabase("Navn")
   Lokale = RSDatabase("Lokale")
   Email = RSDatabase("Email")
   tlf = RSDatabase("tlf")
   udstyr = RSDatabase("Udstyr")
   filepath = RSDatabase("filepath")
   Beskrivelse = RSDatabase("Beskrivelse")
   Datomodtaget = RSDatabase("Datomodtaget")
   Datoafsluttet = RSDatabase("Datoafsluttet")
   Bemaerkninger = RSDatabase("bemaerkninger")
   Sagsnr = RSDatabase("Sagsnr")
   Lokation = RSDatabase("Lokation")    


If DateM <> "" Then
a = Year( DateM ) 

b = Month( DateM )
if CInt( b ) < 10 then b = "0" & b

c = Day( DateM )
if CInt( c ) < 10 then c = "0" & c

j = Hour( DateM )
if CInt( j ) < 10 then j = "0" & j

e = Minute( DateM )
if CInt( e ) < 10 then e = "0" & e

f = second( DateM )

Open in new window


This question is for SQL SERVER 2012 used in windows server 2012 in a classic asp application.  This is in a functionality where we build the whole HTML required in a page in the stored procedure and write it in a classic asp page using response.write. Data in one column in a row exceeds 50k characters at least.  It was working fine until we used SQL SERVER as the driver and declared as varchar(max). But now that we want to use TLS 1.2, we have had to use SQL SERVER NATIVE CLIENT 11.0. Now it allows only 8000 when SQL SERVER NATIVE CLIENT 11.0 is used. We should be able to use a size of char(100000) for our application requirements. Please assist us with your expertise.

Hello Experts,
                         We are attempting to disable TLS 1.0 and 1.1 in our servers. When we did that, our classic asp application did not work and we found that it is using SQL SERVER driver with SQLSRV32.DLL. It threw SSL Security error.
This is the actual connection string we use for Classic asp:
We changed the driver to the SQL SERVER NATIVE CLIENT 11.0. and it solved the problem. Everything else worked except for one page, the monthly calendar page. In the page, we generate the whole HTML for the page data in the database base table and append it directly on the .asp page using response.write.  The page does not throw any error, it simply does not load the data that we get from Database using a Stored Procedure.
When this did not work we used AJAX to get the html data. Even this did not work.
We tried saving HTML data in a variable which also did not happen.

We tried adding Response.ContentType = "text/html"
we installed Microsoft® OLE DB Driver 18 for SQL Server with SQL Server Native Client 11 mentioned as Provider in the connection string. we got other errors.
 Is there any restriction with TLS older versions when we get the HTML directly and append it in a page?
I saw this example but this is using JavaScript

ASP TextBox JavaScript OnKeyup Event

I want to use C# or VB

On a ASP.NET Web Forms page.

I have a TextBox that looks like this:

<asp:TextBox ID="TextBox1" runat="server" ></asp:TextBox>

When I click in the textbox with my mouse how do I save the text "you clicked in the textbox" to a ASP Hidden Field using C# or VB?
I'm using ASP.NET Web Forms and VB

On my page I have a ASP TextBox and a ASP Button

I'm using the TextChanged event for the textbox.

This is my working code for my page


<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ASP_TextBox_TextChanged4.aspx.vb" Inherits="ASP_TextBox_TextChanged4" %>

<!DOCTYPE html>

<html xmlns="">
<head runat="server">
    <form id="form1" runat="server">
                <td><asp:TextBox ID="TextBox1" runat="server" ontextchanged="TextBox1_TextChanged" Text="This is a test"> </asp:TextBox></td>
                <td><asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></td>
                <td><asp:Button ID="Button1" runat="server" Text="Button" /></td>
        <asp:HiddenField ID="HiddenField1" runat="server" />

Open in new window


Partial Class ASP_TextBox_TextChanged4
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    'TextBox.TextChanged Event
    ' Occurs when the content of the text box changes between posts to the server.

Open in new window







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.