ASP

81K

Solutions

31K

Contributors

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
4807/11056/11055/11054/11053/2011/11052/11051/11050/10897/11049/20119/

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
SELECT CastID
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.

Thanks.
Wayne
0
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?
0
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"

SubtractTimes(theMTS,TTime)

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

0
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.)

OK.
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.
https://www.cffcs.com/stuff/VideoTest.asp

Here are the video and form code.
<video width="100%" height="100%" autobuffer controls id="myvideo" src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" type="video/mp4">
</video>
<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();document.displayurl.offseturl.select();"/>
        <input type="hidden" name="Submit" value="Send Video Time" />
        <input type="hidden" name="UID" value="2" />
        <input type="hidden" name="MediaID" value="1" />
      </form>
      <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.
Thanks.
Wayne
0
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
4807/11056/11055/11054/11053/2011/11052/11051/11050/10897/11049/

Open in new window


OK, let's say you only wanted to return the value for
2011
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.

Wayne
0
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';

   }
}

</script>

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" >
</div>

Open in new window


Select-panel:
<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>
      </select>

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

Ulrich
0
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.
0
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;

}
0
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
myConnection.Close
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 :)
0
Experts - Can someone give me code samples for Classic asp with EWS connection please?

Classic asp and not .Net
0
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 (jsmiths@ca--homes.com).
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="*"
            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
            ValidationGroup="AddNewEmail"></asp:RegularExpressionValidator>
0
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
0
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:
<script>
	function delay (URL) {
	setTimeout( function() { window.location = URL }, 500 );
	}
</script>

Open in new window


Thoughts?
0
I'd like to remove quotation marks from the "username" field before it is submitted.
Can this be done with JavaScript ?
0
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

Jim
0
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

0
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 .
0
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
%>
<option><%=PackageOption("item_ID")%></option>
<%
PackageOption.MoveNext
Loop
%>
</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

error:
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?
0
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: https://www.mikesdotnetting.com/article/5/saved-parameter-queries-with-ms-access-and-asp

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
Michael
0
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 asp.net 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?
1
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

0
Experts,
               Greetings!

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.


Thanks,
Isaac
0
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:
DRIVER={SQL Server};SERVER=XXXXXXXX;DATABASE=XXXXXXX;uid=XXXXXX; pwd=XXXXXXX
 
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"
https://msdn.microsoft.com/en-us/library/ms524327(v=vs.90).aspx
 
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?
 
 
0
I saw this example but this is using JavaScript

ASP TextBox JavaScript OnKeyup Event
https://forums.asp.net/t/1656156.aspx?onkeyup+in+asp+textbox

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

ASP_TextBox_TextChanged4.aspx

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

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table>
            <tr>
                <td></td>
                <td><asp:TextBox ID="TextBox1" runat="server" ontextchanged="TextBox1_TextChanged" Text="This is a test"> </asp:TextBox></td>
            </tr>
            <tr>
                <td></td>
                <td><asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></td>
            </tr>
            <tr>
                <td></td>
                <td><asp:Button ID="Button1" runat="server" Text="Button" /></td>
            </tr>
        </table>
    </div>
        <asp:HiddenField ID="HiddenField1" runat="server" />
    </form>
</body>
</html>

Open in new window


ASP_TextBox_TextChanged4.aspx.vb

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

0

ASP

81K

Solutions

31K

Contributors

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.