[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x

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

I have been adding an attribute (linkToItem="TRUE") specific list item columns for some of my list views (using SPD on their ASPX files).  It works great, however if I subsequently return to the view to say add or remove a filter, the attribute gets removed (I expect that SP is regenerating the view).

Any suggestions on this would be appreciated.

Also, in the same vein,  how can I remove the hyperlink from a view column:
0
Build an E-Commerce Site with Angular 5
LVL 12
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

I have a long text that has this string$

.... value="variablechars" .....

or
.... value='varchars'....

I need to implement a regular expression in asp to extract these strings and create a list (each record with 2 items)

Once extracted I have no problem in creating the list in my database

the list

name1, value="str1"
name2, value="str2"
name3,value="str3"

name4,value='str4'
name5,value='str5'
name6,value='str5'

I extract email with this code (asp)

Set RegularExpressionObject = Server.CreateObject("VBScript.RegExp")
With RegularExpressionObject
 .Pattern = "[_a-zA-Z\d\-\.]+@[_a-zA-Z\d\-]+(\.[_a-zA-Z\d\-]+)+"
 .IgnoreCase = True
 .Global = True
 End With

 StringToSearch = blocks(x)
 set objMatches = RegularExpressionObject.Execute(StringToSearch)
 for each objMatch in objMatches
 email=objMatch.value
 next

Also extract  strings as

&nbsp;Actividad <br/>

I guess I am missing the Pattern

Example

<img src="image.png" />&nbsp;Actividad <br/><input type="text" readonly class="textboxif" style="width: 410px;" value="Name of activity" name="sector" id="sector"/></td><td>

Here the items would be

Actividad,Name of activity

I have many atrings that I have to extract the data from

Any ideas?
0
Dear all,

Could I get the absolute url from a relative url placed into an input form?

Example:

Input text = "www.elmundo.es"
absolute url = https://www.elmundo.es

Input text = "w3guy.com/relative-absolute-url-guide/"
absolute url = https://w3guy.com/relative-absolute-url-guide/

Input text = "www.filosofia.org/rev/bas/"
absolute url = http://www.filosofia.org/rev/bas/

There are dozens of solutions to get absolute url from a relative url on address bar (the url of the open page), but not from an input form.

I just make a question ultimately!

Could someone help me to find a solution for this case

Thanks
1
PROBLEM RESOLVED -- Pretty strange anomaly. The array names are being passed with a left paren, i.e. FieldName is FieldName(  . Pretty bizarre, but I figured it out.

I have a form that will have an unknown number of rows in it. The user is to select the rows that they want and then click the submit button. I store the values for each of the rows (they are filenames) in an array. The values are passed via POST. I can't figure out how to retrieve the array values in the receiving page. This is being written in Classic ASP.

I can do a :
For Each Item In Request.Form
    fieldName = Item
    fieldValue = Request.Form(Item)
    Response.Write fieldName & " " & fieldvalue & "<br />"
Next

and all the values are there. How do I get the passed array values assigned to elements in a receiving array so I can work with the data?
0
Hi, Experts, I wish to include AM/PM on the date base on the solution below. Thanks!

<%
d = CDate(Now)
dim dd, mm, yyyy

dim darr
darr = split(FormatDateTime(d,0),"/")

dd = darr(0)
mm = darr(1)
yyyy = darr(2)

d = mm & "/" & dd & "/" & yyyy 

response.write(d)
response.end()

%>

Open in new window

0
Hi all, I am trying to get an autosum working adapting this code:
https://jsfiddle.net/SG7gu/289/

mycode:
I have not changed the javascipt (put in <script language=javascript>) nor the css (put in <style>) and closed off
			Set PackageItemHero=oConn.Execute("SELECT * FROM prod_items,items WHERE prod_items.item_ID=items.item_ID AND pitem_live=TRUE AND dep_ID="&Request.QueryString("d")&" AND pitem_ID=pitem_alt")
			Do Until PackageItemHero.EOF
			MainArea=MainArea&"<tr>"
			MainArea=MainArea&"<td height=50 align=center><img src="&BrandDir&"/c-"&PackageItemHero("item_type")&".png width=40 height=40></td>"
			MainArea=MainArea&"<td height=50 colspan=2><font size=5>"&PackageItemHero("item_name")&"</font></td>"

			MainArea=MainArea&"<td height=50 align=center><label><input type=radio name="&PackageItemHero("pitem_ID")&" value="&PackageItemHero("pitem_gross")&" checked></label></td>"

			MainArea=MainArea&"<td height=50>&nbsp;Included&nbsp;</td>"
			MainArea=MainArea&"</tr>"
			Set PackageItemHeroType=oConn.Execute("SELECT * FROM items,item_type WHERE item_type=itype_ID")
			Set PackageItemOption=oConn.Execute("SELECT * FROM prod_items,items WHERE prod_items.item_ID=items.item_ID AND pitem_live=TRUE AND dep_ID="&Request.QueryString("d")&" AND NOT pitem_ID=pitem_alt AND pitem_alt="&PackageItemHero("pitem_ID"))
			If NOT PackageItemOption.EOF Then			
			MainArea=MainArea&"<tr>"
			MainArea=MainArea&"<td height=15></td>"
			

Open in new window

0
Hi there, I have been looking around but unable to find specifically what I want...

I have an ASP Classic website (tables, rows, columns, not div) and I want to add expand and collapse fields

found plenty for div, but not much (that make any sense) for tables, any help on this would be great
0
Looking for a sql server/classic asp expert to look at my results code on the link below to suggest changes for efficient querying.  We have a very big day coming up soon with one event of over 6000 participants and I want to know if my code is optimized to avoid logjams.  This is something that I would be willing to entertain bids on.

https://www.gopherstateevents.com/results/cc_rslts/cc_rslts.asp?sport=Cross-Country&meet_id=505&rslts_page=overall_rslts.asp&show_indiv=n

Thank you!.
0
I have an asp page which has several fields and I got stuck at drop down button which has to populate data from a query.
But whenever I wrote some code taken from different examples from online I will get http404 error.

How to overcome it.
 my sql query is select cur_date_str,cur_effective_date from tblmovedate; where I need drop down to be filled with cur_effective_date data.

Please help me
0
Hi,

We have the following Javascript code that is used on our intranet to hide/show side menus.

This code has been working perfectly fine for the last year or so and was written by someone who no longer works for the company. However over the past couple of days the side menus have stopped working in Google Chrome on all computers.

We are getting the following error:


Error

function show(menuChoice)
	{
		var el = document.getElementById(menuChoice);
		if ( el.style.display != 'none' )
			{
				Animation(document.getElementById(menuChoice)).to('height', '0px').to('opacity', 0).hide().go();
			}
		else
			{
				Animation(document.getElementById(menuChoice)).to('height', 'auto').from('0px').to('width', 'auto').from('0px').to('opacity', 1).from(0).blind().show().go();
			}
	}

function hide(menuChoice)
	{
		var el = document.getElementById(menuChoice);
		if ( el.style.display != 'none' )
			{
				Animation(document.getElementById(menuChoice)).to('height', '0px').to('opacity', 0).hide().go();
			}
		else
			{
				
			}
	}

Open in new window


Thanks, Greg
0
PMI ACP® Project Management
LVL 12
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

I have a lot of experience programming in MS Access VBA and some experience with classic ASP.

I created a website using classic ASP many years ago which uses MS SQL Server as the backend database engine.

Website visitors can enter a part number in a search box I generated and view a list of parts that are returned as search results.

I would like to add a shopping cart and payment gateway to my existing website but do not know where to start.
My existing code determines the item, quantity, and part number that the buyer wants to purchase.

It seems that I should be able to obtain a collection of pages that I can add to my site that will create the shopping cart and provide a payment gateway.
I should have no trouble integrating this "shopping cart code" with my existing code if it allows me to GET or POST to pass data.

Can anyone suggest a product I can use or someone I can hire to complete the project?

Thanks
0
I have and asp scrpit thta passes data to a php script via  post in a form.

All is ok except that whn the data passes it to large (too many bytes) I doesn't pass all the variables

As long as the amout of data remains relatively small all is ok.

I test passing the data to aan asp script and it passes it all.

Any ideas?

Thx
0
Hi, Experts, I need to know how it's possible to include in the manifest="offline.manifest" a messages from the server computer via Ajax and that message will store at the same time in the session storage and will be used during offline. I'm trying to develop an offline browser but getting difficult how to achieve that goal.  I used body onload event to trigger the Ajax and obtain the messages from the server thru ASP. <body onload="return GetMsg()"> My goal here is to retain or include the messages in the session storage and be used during offline. Any help please!  

<script>var msg;</script>
<script>
function GetMsg()
{
    debugger;
    var str = "E"
    {
        var xmlhttp = new XMLHttpRequest();
        xmlhttp.onreadystatechange = function() 
        {
          debugger;
            if (this.readyState == 4 && this.status == 200) 
            {
                msg = this.responseText;
            }
        };
        xmlhttp.open("POST", "GetHint.asp?q=" + str, true);
        xmlhttp.send();
    } 
}

</script>

Open in new window


The offline.manifest
CACHE MANIFEST
styles.css
jquery-1.4.min.js
offline.js
index.html

Open in new window

0
Hello

I am using class asp and in the IE i am getting this error "Object doesn't support property or method 'startRequest'". on further looking into the code, i found it that the error is from RS.HTM page , which is  a java applet....can any one help me out.
0
Hi, Experts, I'm trying to get an item within the array where I use the first word of the item as its reference. I found a code from asp tutorial that may lead to solve the problem but I'm still not able to solve it. Hoping you (Experts) help me solving this problem. This is my array; fruits = Array("100 Banana","200 Apple","300 Orange") I want to get the orange using 300 as its refrence. I have the code below but I don't know how to make it right. Thank you!

<%
DIM findThis
findThis = "300"
fruits = Array("100 Banana","200 Apple","300 Orange")

If in_array(findThis, fruits, false) Then 
  Response.Write Orange & " is in the array"
Else 
  'Response.Write findThis & " is not in the array"
End If

%>

<%
Function in_array(element, arr, performTrim)
  Dim i
  in_array = False
  For i=0 To Ubound(arr)
    If performTrim Then '//there are some scenarios where you want to trim
      If Trim(arr(i)) = Trim(element) Then
        in_array = True
        Exit Function      
      End If
    Else '//and other scenarios where you don't
      If arr(i) = element Then
        in_array = True
        Exit Function      
     End If
    End If     
  Next
End Function
%>

Open in new window

0
I have a classic ASP web page that uses Jmail to send messages.  The hosting company did a upgrade on their server a week ago. My script continued to work until today. I was told I should try using SMTP authentication instead of LocalHost.  No luck. Getting error message.  

ERROR: SendJmail The message was undeliverable. All servers failed to receive the messageSent as plain text.

Can someone tell me if I made the right changes?

The line Mailer.ServerAddress = "localhost"

Was replaced with the following lines

mailer.serverAddress = "sm04.internetmailserver.net"
mailer.port = 25
mailer.username = "[my email address]"
mailer.password = "[my password]"
0
I've got a website on shared hosting platform that I think go messed up when they updated the .net framework on the server.  I have several sites that are currently not working correctly.  I don't have direct access to the server so that kind of makes it difficult to troubleshoot directly.  So I have to keep emailing their support.

The site I am currently having an issues with is http://www.formulaboatsmo.com, I use a framework from DMXzone.com for my database calls, it uses a combination of javascript and asp.net for the functions.  The site is written in classic asp.  So what started happening is my asp database driven sections aren't working.

I get this error: 006~ASP 0178~Server.CreateObject Access Error~The call to Server.CreateObject failed while checking permissions. Access is denied to this object.

The developer(dmxzone) believes the issue is with the permissions on the System.security.dll should have read/read&execute.

I'm at a loss of what to do or direction to take.  If you load just this page: http://formulaboatsmo.com/dmxConnect/api/Boats/FrontSecondaryRandom.asp it will show you all the errors being kicked up.  Sites worked perfectly until the .net updates.

{"type":"Error","fileName":"lib/core/parser.asp","lineNumber":86,"message":"006~ASP 0178~Server.CreateObject Access Error~The call to Server.CreateObject failed while checking permissions. Access is denied to this 

Open in new window

0
Hi there, I was wondering if someone can help me/guide me in the right direction of a crypo currency API and a script (or alter an existing script) to call the data

I have found this Crypo API - http://www.coinapi.io/ (https://docs.coinapi.io/)

URL: https://rest.coinapi.io/v1/exchangerate/USD?apikey=APIcryptoKEY

The script I already have, uses a currency API to get the data and I was wondering if it is possible to modify this (this script was built by someone else):
	Dim oJSON
	Set oJSON = New aspJSON

	Set oConn=Server.CreateObject("ADODB.Connection")
	oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("core/allcore.mdb")

	Set Currencies=oConn.Execute("SELECT ticket_curr FROM tickets WHERE ticket_from>Now() AND ticket_live=TRUE AND ticket_soldout=FALSE Group By ticket_curr Order By ticket_curr")
	CurrCount=0
	Do Until Currencies.EOF
	If CurrCount=0 Then
		Curr=Currencies("ticket_curr")
	Else
		Curr=Curr&","&Currencies("ticket_curr")
	End If
	Set CheckCurr=oConn.Execute("SELECT * FROM site_curr WHERE curr_ID='"&Currencies("ticket_curr")&"'")
	If CheckCurr.EOF Then
		oConn.Execute("INSERT INTO site_curr(curr_ID) VALUES('"&Currencies("ticket_curr")&"')")
	End If
	CurrCount=CurrCount+1
	Currencies.MoveNext
		Loop

	Set oXMLHTTPClient=CreateObject("MSXML2.ServerXMLHTTP")
	

Open in new window

0
Hi EE! :)

Our website has been working flawlessly until recently - we noticed that some pages began to intermittently load slowly, hanging for somewhere between 10-30 seconds, sometimes loading successfully after a considerable wait, but in many cases leading the application in the app pool to hang for a long time, and sometimes requiring a manual restart of IIS. Even restarting IIS takes a long time when it's hanging.

The website is several years old and coded in classic ASP/VB - the pages seemingly causing the bother are fairly heavy ones in regard to sever side code with lots of recordsets etc, but have NEVER caused any problems until the last couple of weeks or so.

The website app runs in 32bit compatibility mode set in the IIS apppool (We use 32bit mode as we're connecting to a 32bit mysql database on another server via win-mysql 32bit ODBC connector)

Where things stand currently:

  • No changes have been made to our classic ASP application source code.
  • No applications were installed recently on the server.
  • No changes made to the website conf/app in IIS
  • Disk space looks fine. Disk check OK. CPU looks OK.

What I have done so far without success:

  • Deleted website & app in IIS and recreated.
  • Isolated website in IIS - turned all other websites and apps off.
  • Uninstalled windows updates < 80 days (I have since reinstalled after discovering it made no difference)
  • Performed a system restore of server state/config < 75 days
0
Become a Microsoft Certified Solutions Expert
LVL 12
Become a Microsoft Certified Solutions Expert

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

Hi, Experts, My code below is working but having so much delay in terms of response. Is there any other way here to achieve the goal but not having so much delay? This is the scenario, I have two table Stock, and ActualCount. They have common field, Procode. First, I need to loop the Stock and each procode of it  will be going to check in table ActualCount to check the status. The code below is having so much delay and sometimes receive an error response from the server. Any help please!

<%
On Error Resume Next
dim theServer, dsqty, cntcode, qty, pcode, x

cntcode = request.querystring("b")
deptcode = request.querystring("c")

response.expires=-1
Set rs = Server.CreateObject("ADODB.Recordset")
set cn=Server.CreateObject("ADODB.Connection")
cn.ConnectionString = "driver={SQL Server};server=" & "MyNoteBook" & "\SQLEXPRESS;uid=sa;pwd=3808;database=" & "Winz" & ";ConnectionTimeout=10;"
cn.Open

If Err.Number <> 0 Then
    Response.Write(  Err.Number & "|" & Err.Description )
    Response.End()
End If
   Set rs = cn.Execute("Select * from Stock where DPTID='" & deptcode & "' and Own='" & "Men" & "' And Active='" & "Yes" & "' order by proname asc")
      with rs
         If rs.BOF = True Then 'No record
             response.write("No records!")
             response.end()
         else
      response.write("<table style=""width:890px; height: 600px"" id=""CountesStock"" class=""PoRaX"">")
         response.write("<thead style=""width:890px;"">")
            

Open in new window

0
Hi,

I need to write this code in global.asa. GetLastDateandTime is working fine. I need to put that in the session. If user is present then we get the data from the database. This function is working fine. If user is not present then we are using update function. My update function is not working. Page is down. I am not sure how to fix the update function.

Sub S[b]ession_OnStart[/b]

Dim objConn, objRs, strConn

Set objRs = Server.CreateObject("ADODB.Recordset")

Set objConn = Server.CreateObject("ADODB.Connection")                                                                                     

             

strConn = "test;"

 

objConn.Open strConn

dim strUser

strUser = request.servervariables("logon_user")

dim strDateAndTime = Now()       

If (strUser <> "" ) then

    Session("LastDateTime") = GetLastDateandTime(strUser, objRs,objConn)

else
[b]
   UpdateLastDateAndTime(strUser, strDateAndTime, objRs,objConn);[/b]

End If

 

Set objRs = Nothing

Set objConn = Nothing

End If

 

End Sub

 

 

Function GetLastDateandTime( ByVal strUser, ByRef objRs, ByRef objConn)

'--------------------------------------------------------------------------

'-------------------------------------------------------------------------

    Dim cmd

             

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

       Set cmd.ActiveConnection = objConn

 

       cmd.CommandText = "usp_GetLastDateandTime"

       cmd.CommandType

Open in new window

0
How to display the Session Timeout Warning Dialog in Classic asp? I want to display the session timeout warning at 13 minutes and session will  timeout at 15 minutes.

Dialog will have yes and no buttons. Yes button will again extend the session and No button will just cancel the dialog and session will timeout in 2 minutes.

How this can be done in classic asp?
0
LDAP Query : Table does not exist.
Hi all : thanks for taking the time to read my question.  I need some assistance with a strange LDAP issue.

ERROR: |80040e37|Table_does_not_exist.

We have ldap accessing code in the following format, Some times it's working,but is producing errors like above ERROR

Dim objRootDSE, objCon, objCmd, objRecordSet
Dim strDomainAdsPath
Dim arrMembers
Dim intCount
Dim strmember,strLoggedInUser, strUserStrId, strUserId,blnIsMemberOf, strDomPath,name
response.write strUser + "<BR/>"
Dim ServiceRequest
Dim MagicTicket
ServiceRequest=Request.QueryString("SR")
MagicTicket=Request.QueryString("MT")

	Dim  strPassword, strQuery, oConn, cmd, oRS, Dom, mail,strUsername,firstname,lastname,fullname,URL,PathSAP
	strUserId=""
EMEAUSERNAME = ""
EMEAPASSWORD = ""
Dom="emea"

				Set objRootDSE = GetObject("LDAP://RootDSE")
				strDomainAdsPath = "LDAP://" & objRootDSE.Get("defaultNamingContext")
				response.write strDomainAdsPath + "<BR/>"
				strDomPath=objRootDSE.Get("defaultNamingContext")
				Set objRootDSE = Nothing
				Set objCon = Server.CreateObject("ADODB.Connection")
				objCon.Provider = "ADsDSOObject"
				objCon.Open "ADProvider", EMEAUSERNAME, EMEAPASSWORD
				Set objCmd = Server.CreateObject("ADODB.Command")
				Set objCmd.ActiveConnection = objCon
				'objCmd.CommandText = "Select name,mail,UserPrincipalName from '" & strDomainAdsPath & "' where objectClass='user' and UserPrincipalName ='" & strUserfull & "'"
				objCmd.CommandText 

Open in new window

0
I have a query in Classic ASP that has the potential to grow to thousands of rows.



  <%

' Our own constants:
Const PAGE_SIZE = 10  ' The size of our pages.

' Declare our variables... always good practice!
Dim strURL     ' The URL of this page so the form will work
               ' no matter what this file is named.

Dim cnnSearch  ' ADO connection
Dim rstSearch  ' ADO recordset
Dim strDBPath  ' path to our Access database (*.mdb) file

Dim strSQL     ' The SQL Query we build on the fly
Dim strSearch  ' The text being looked for

Dim iPageCurrent ' The page we're currently on
Dim iPageCount   ' Number of pages of records
Dim iRecordCount ' Count of the records returned
Dim I            ' Standard looping variable

' Retreive the URL of this page from Server Variables
strURL = Request.ServerVariables("URL")

' Retreive the term being searched for.  I'm doing it on
' the QS since that allows people to bookmark results.
' You could just as easily have used the form collection.
strSearch = Request("search")

' Retrieve page to show or default to the first
If Request.QueryString("page") = "" Then
	iPageCurrent = 1
Else
	iPageCurrent = CInt(Request.QueryString("page"))
End If


If strSearch = "" Then

  'Display all the details passed

			'	for i=1 to request.form.count
			'	response.write Trim(request.form.key(i))&"; "& Trim(request.form.item(i)) &"<br>"
			'	Next

		'Response.End 
	
	Set cnnSearch = Server.CreateObject("ADODB.Connection")

	' This line is for the 

Open in new window

0
I am maintaining an old, old classic ASP site - there is a form which includes the following tag around the "submit" image:

<a href="javascript:ValidateMakeForm();" onMouseOver="msover(1); return true" onMouseOut="msout(1)">

The function is defined on the page like below - basically sets the form action and submits the form.

<script language="javascript">
function ValidateMakeForm()
{
	if (document.forms['searchmake'].category_id.selectedIndex == 0)
	{	
		alert("You must select a make.");
		document.forms['searchmake'].category_id.focus();
		return;
	}
	document.forms['searchmake'].action = document.forms['searchmake'].category_id.value;
	document.forms['searchmake'].submit();
}
</script>

Open in new window


IE 11 is throwing an error 'ValidateMakeForm' is undefined.   Everything works in Chrome, Firefox and Edge and even in IE 11 when viewed in Compatibility Mode.
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.