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

When reading the File of size  3MB or bigger  from remote filesystem using ADODB.Stream LoadFromFile method it gives not responding issue in IE for 30 sec.

theStream = new ActiveXObject("ADODB.stream");
theStream.LoadFromFile("\\server\c:\upload\rose.png");

I am looking for solution for above. Please comment if Any suggestion or solution exists for above not responding Issue
1
Angular Fundamentals
LVL 12
Angular Fundamentals

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

Hi, Experts,
I just want to know how the hackers can penetrate my database. I am about to lunch my small project called, Daily Time Record (DTR) but I'm doubt the safety of it. The way I used to save the personnel data into my database is something like the code below. I am using Sql8. Is there anything to add to improve and keep away from hackers? Please give me some ideas.. Thanks!

<%
On Error Resume Next
dim icode,title,iname,famna

icode = request.querystring("a")
title = request.querystring("b")
iname = request.querystring("c")
famna = request.querystring("d")

db = request.querystring("db")
theServer = request.querystring("sr")


Set cn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")

cn.ConnectionString = "driver={SQL Server};server=" & theServer & ";uid=sa;pwd=3388;database=" & db & ""
cn.Open

If Err.Number <> 0 Then
   Response.Write(  Err.Number & "|" & Err.Description )
   Response.End()
end if

   cn.execute("Insert into Personnel(theCode,TheTitle,TheName,TheFamilyName) values('" & _
                         icode & "','" & title & "','" & replace(iname, "'","''") & "','" & replace(famna, "'","''") & "')")
   cn.close
	set cn = nothing

   response.write("Successfully enrolled new item!")    				      	
   response.end()
   
On Error GoTo 0
%>

Open in new window

0
Hello Experts,

In our classic asp application which serves hotel industry, when a user logs out the application, we will clear the sessions so that other system users will not able to login with the URL without logging in with the credentials.

But when the user directly closes the pop-up window or the browser tab or when the page is reloaded/refreshed we are not able to track it to clear the session. Need help on this, please.

This is the code we use:



When we use window.onbeforeunload function


 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript">
    $(function () {
     
         $("li a").click(function () {
            window.onbeforeunload = null;
        });
             $("a").click(function () {
            window.onbeforeunload = null;
        });
        $("a").not('#lnkLogOut').click(function () {
            window.onbeforeunload = null;
        });
        $(".btn").click(function () {
            window.onbeforeunload = null;
        });
    });
    function getxmlobject() 
    { var x = null; 
        try { x = new xmlhttprequest(); }
        catch (e) { try { x = new activexobject("msxml2.xmlhttp"); }
            catch (e) { x = new activexobject("microsoft.xmlhttp"); } } return x; 
    }

    window.onbeforeunload = function (e) {
        debugger;
        
        if (show_close_alert) {
     
            var xmlLoginvalues = GetXmlObject();

            if 

Open in new window

0
ASP.net
VB.net

I have three tables that I need to compare and use a checkbox

Table one - list of all the stores
Table two - list of managers
Table three - list of store assignments

Table three is the one that needs to be able to update / add / delete

I would like a list of all the stores when a manager is picked (dropdown list) in one gridview, and the ability to check (assign a store to) and uncheck (remove an assigned store).  Table one and two are static and will never change.

Any help would be great!  I am stuck on how to do the SQL statement and the code for the gridview
0
I need to validate my invisible recaptcha in server side

I have an  native .asp file to get user data and email it,
how to validate the recaptcha in there?

<!DOCTYPE html>
<html>
<head>
    <title></title>
	<meta charset="utf-8" />
</head>
<body>

<%

      
set conn=Server.CreateObject("ADODB.Connection")
'conn.Provider="Provider=SQLOLEDB"
conn.Open "Provider=SQLOLEDB;data source=Comensaaasrios.mssql.soasaae.com;packet size=4096;user id=xxxx;pwd=xxxx;persist security info=False;initial catalog=xxxx"

sql="INSERT INTO comentarios (nombre, email,telefono, producto, comentario)"
sql=sql & " VALUES "
sql=sql & "('" & Request.Form("fname") & "',"
sql=sql & "'" & Request.Form("email") & "',"
sql=sql & "'" & Request.Form("telefono") & "',"
sql=sql & "'" & Request.Form("consultorio") & "',"
sql=sql & "'" & Request.Form("message") & "')"

on error resume next
conn.Execute sql,recaffected
if err<>0 then
  Response.Write("Error, Intente otro metodo de contacto!")
 Response.Write("<a href='http://www.oncolosdsdsjio.com'><h3>Regresar a página de contacto.</h3></a>")
else
 Response.Write("<h3>Nos pondremos en contacto lo antes posible.</h3>")
 Response.Write("<a href='http://www.oncolosdsdsbajio.com'><h3>Regresar a Oncolosdsddsdsío.</h3></a>")
       
end if
conn.close
    
%>
<%
Dim smtpserver,youremail,yourpassword,ContactUs_Name,ContactUs_Tel,ContactUs_Email
Dim ContactUs_Subject,ContactUs_Body,Action,IsError

smtpserver = "smtp.gmail.com"
youremail = 

Open in new window

0
I use Mandrill for my smtp server to send emails from my website.  We generally send race results to individual participants and coaches.  Last fall my account was hacked.  I followed Mandrill's suggestions to modify my security and they restored my account reputation and hourly send limit and all was good.  Recently I started getting emails from Mandrill indicating that my account reputation was poor and noticed that my hourly send quota was very limited.  I contacted them and was told that the initial restoration of reputation and hourly quota was a 30-day fix and it now had to "restore itself" over time.  I don't have the time.  We will be timing roughly 3000 runners on Thursday and sending them pre-race emails the day before.  Does anyone have a suggestion for another utility that I can use to send emails from my classic asp site as indicated above?  I would appreciate any help I can get.
0
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
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
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
Why Diversity in Tech Matters
LVL 12
Why Diversity in Tech Matters

Kesha Williams, certified professional and software developer, explores the imbalance of diversity in the world of technology -- especially when it comes to hiring women. She showcases ways she's making a difference through the Colors of STEM program.

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
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
Introduction to R
LVL 12
Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

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

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.