Improve company productivity with a Business Account.Sign Up

x

ASPSponsored by Flatiron School

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 the following code that display my calandar. I had to write it in asp/vbscript to comply with the actual solution


 <%

Dim currDate, nMonth, nDay, nYear
Dim lastMonth, lastYear, lastFirstDayPos, lastNumDays, submit
Dim numDays, monthName(13), count, pos, firstDayPos, eventDay, dayNum, cell(38)
Dim events(38)
Dim test1, test2, test3 ' used in leap year calcs
dim hideButton

If Request.Form("submit") <> "" Then

lastMonth = Int(Request.Form("lastMonth"))
lastYear = Int(Request.Form("lastYear"))
lastFirstDayPos = Int(Request.Form("lastFirstDayPos"))
lastNumDays = Int(Request.Form("lastNumDays"))
submit = Request.Form("submit")

End If

currDate = Date ' Date contains the current system date.
nMonth = Int(Month(currDate)) ' integer value 1 to 12
nDay = Int(Day(currDate)) ' integer value 1 to 31
nYear = Int(Year(currDate)) ' integer value yyyy
dayOfWeek = Int(Weekday(currDate)) ' integer values 1 to 7 (note diff from mini-SQL 0-6)


%>

<HTML>
<HEAD>
<TITLE>Calendar</TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff" TEXT="#00000">
<CENTER>
<TABLE BORDER="1" cellspacing="2" CELLPADDING="2">

<%

' Previous or Next Month (passed values)

If submit = "Previous Month" Then
    nMonth = lastMonth - 1
    'nYear = lastYear -1
    If nMonth = 0 Then
        'nYear = nYear - 1
        nMonth = 12
    End If
end if


If submit = "Previous Month" Then
    nMonth = lastMonth - 1
    'nYear = lastYear -1
    If nMonth = 0 Then
        'nYear = nYear - 1
        nMonth = 12
    end if

Open in new window

0
Free Tool: Path Explorer
LVL 12
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

what web server language for this code:

<!DOCTYPE html>
<html>
<body>
     <h1>Hello Web Pages</h1>
     <p>The time is @DateTime.Now</p>
</body>
</html>

I have a windows server that supports asp and asp.net but it's don't provide the date time. I try to change the file extension to asp or aspx but the problem stays.

thnaks a lot
0
Hi, Experts, I need to delete or drop my Database using .asp or vbscript command, how? My code below is not working, I'm having an error says, "-2147217865|[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot drop the database 'Jyle761234', because it does not exist or you do not have permission."

<%
On Error Resume Next

response.expires=-1

set cn=Server.CreateObject("ADODB.Connection")
cn.ConnectionString = "driver={SQL Server};Server=" & "winzServer" & "\SQLEXPRESS;uid=sa;pwd=3970;"
cn.Open

    cn.Execute "DROP DATABASE Jyle761234;"
    cn.Close
   
If Err.Number <> 0 Then
   response.Write(  Err.Number & "|" & Err.Description )
   response.End()
else
   response.write("Database has been deleted!")
   response.end()
end if
%>

Open in new window

0
I have an ASP page that pulls data in from several different excel forms and displays them by campus. for each different campus I make a new record set. once they are all displayed what I want to do is allow a user to click a link in their section that will then open another ASP page and carry over only the particular record they clicked the link on and be able to add a comment as to why the record is out of compliance. Below is the code I am currently using to display the data:

<html>
<%


		vXlsFile = "/virtual/data/AU.xlsm"

		vXlsFile = Server.Mappath(vXlsFile)
		
		vXlsFile1 = "/virtual/documents/TechReport/ScholasticRecord.xlsm"
		vXlsFile1 = Server.Mappath(vXlsFile1)

		vXlsFile2 = "/virtual/documents/TechReport/PersonalInfo.xlsx"
		vXlsFile2 = Server.Mappath(vXlsFile2)
		
		
		
		
		ExcelConnString = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
		"Data Source=" & chr(34) & vXlsFile & chr(34) & ";" & _
		"Extended Properties=" & chr(34) & "Excel 12.0;" & chr(34)
		
		'Response.write ExcelConnString
		'Open Database Connection
		Set Conn = Server.CreateObject("ADODB.Connection")
		Conn.Open ExcelConnString
		
		
		XlsConnString = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
		"Data Source=" & chr(34) & vXlsFile1 & chr(34) & ";" & _
		"Extended Properties=" & chr(34) & "Excel 12.0;" & chr(34)
		
		'Response.write ExcelConnString
		'Open Database Connection
		Set xConn = Server.CreateObject("ADODB.Connection")
		xConn.Open XlsConnString

	XlsxConnString = 

Open in new window

0
We cannot make a REST call using Classic ASP over TLS 1.2. This call is to get the authorization token from Paypal. We have tried lots of code variants with no success:

Example 1:
            Set xmlHttp = Server.CreateObject("WinHTTP.WinHTTPRequest.5.1")
            xmlHttp.Open "POST", "https://api.sandbox.paypal.com/v1/oauth2/token", False
            xmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
            xmlHttp.setRequestHeader "Accept", "application/json"
            xmlHttp.setRequestHeader "Accept-Language", "en_US"
            basico = "Basic " & Base64Encode(paypal_client_id & ":" & paypal_client_secret)
            xmlHttp.setRequestHeader "Authorization", basico <== "Invalid procedure call or argument"
            xmlHttp.Send "grant_type=client_credentials"

Example 2:
            Set xmlHttp = Server.Createobject("MSXML2.ServerXMLHTTP.6.0")
            xmlHttp.Open "POST", "https://api.sandbox.paypal.com/v1/oauth2/token", False
            xmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
            xmlHttp.setRequestHeader "Accept", "application/json"
            xmlHttp.setRequestHeader "Accept-Language", "en_US"
            basico = "Basic " & Base64Encode(paypal_client_id & ":" & paypal_client_secret)
            xmlHttp.setRequestHeader "Authorization", basico
            xmlHttp.Send "grant_type=client_credentials"  <== "An error occurred in the secure channel support"

Also, we've been able to make it with .NET and with PHP at the same server.
0
My site formally used a URL rewrite component called LinkFreeze to change the URL's to "SEO friendly URLs".
EX: 'www.mysite.com/category.asp?cat=3&subcat=2'  would be changed to  'www.mysite.com/category~3~subcat~2.asp'

Moving forward to 2018... I'm unable to use this component anymore so there are thousands of orphan URL's out there.  I wrote a simple script for a custom 404 page that redirects the URL to the correct (original) format of 'www.mysite.com/category.asp?cat=3&subcat=2'.  This works, but I was hoping there was a way to do a 301 redirect using URL Rewrite.  I'm open to any suggestions.
0
When uploading a file bigger than 100kb with classic asp to the server it hangs up.

Size Limits and Timeout limits on IIS were changed,

Does anyone have an idea why do i have this problem?

Thank you
0
I am using Classic ASP. One of my pages runs a Stored Procedure that returns a list of contacts, some of them have emails some don't.

The email field is:  <%=(report_results.Fields.Item("Email").Value)%>

Is there a way to pass to the next page a list of emails separated by comma saved in a Session variable?  
Something like:   session("email_list") =   ALL <%=(report_results.Fields.Item("Email").Value)%> separated by comma  |  Those contacts without an email are simply ignored.
0
Hello I was working good and suddenly my windows server stopped sending emails via cdosys.asp and I found was list in CBL. They say: This IP address was detected and listed 85 times in the past 28 days, and 14 times in the past 24 hours. The most recent detection was at Thu Apr 5 15:05:00 2018 UTC +/- 5 minutes

The listing of this IP is because it HELOs as a bare IP address (A bare ip address looks like: "54.33.33.5"). It is not HELO'ing as itself ("xxx.xxx.xxx.xxx").

I have windows 2008 and almost we don’t send email just the normal reports of a LMS.

How can I fix the problem I just use my regular IP like years but suddenly stopped working.

Thank you
0
get data from database do normal
after then i don't know what to do
i found some example pages but i coudn't find fit answer for me
i am begginner so can u answer and explain the code?      
my goal is following this page https://datatables.net/examples/server_side/simple.html                        
<% if objrs.bof or objrs.eof then %>
						<tr align="center">
						<td colspan="5">글이 없습니다.</td>
						</tr>
						<%
							Else
							'게시물이 있으면 objrs로 현재 페이지와 페이지 크기에 따라 objrs 이동
							objrs.move(intNowpage-1) * intPageSize
							'계속해라 게시물이 끝날때까지
							do until objRs.eof
						%>
						<tr>
							<td><a href="content.asp?seq=<%=objRs(0)%>&page=<%=intNowPage%>&AscDesc=<%=AscDesc%>"><%=objrs(0)%></a></td>
							<td><a href="content.asp?seq=<%=objRs(0)%>&page=<%=intNowPage%>&AscDesc=<%=AscDesc%>"><%=objRs(3)%></a></td>
							<td><a href="content.asp?seq=<%=objRs(0)%>&page=<%=intNowPage%>&AscDesc=<%=AscDesc%>"><%=objRs(1)%></a></td>
							<td><%=left(objrs(5),10)%></td>
							<td><%=objrs(4)%></td>
						</tr>
						<% 
							'다음 objrs로 넘어감
							objrs.movenext
							loop
							end if
							objRs.close
							set objRs = nothing
							objDBConn.close
							set objDBConn = nothing
						%>

Open in new window

0
What Kind of Coding Program is Right for You?
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

I'm using jRecorder to record voice with SWF. The component basicly working in PHP properly. But I should adapt this to Classic-ASP



There is buttons, when I try click to "Send Data", it sends data to "INC_AcceptFile.asp?filename=test.wav" but unfortunatelly I couldn't save the file.

jRecorder Github page:
github.com/sythoos/jRecorder/

<script> 
   $.jRecorder(
     { 
        host : 'INC_AcceptFile.asp?filename=test.wav' ,  //replace with your server path please
        callback_started_recording:     function(){callback_started(); },
        callback_stopped_recording:     function(){callback_stopped(); },
        callback_activityLevel:          function(level){callback_activityLevel(level); },
        callback_activityTime:     function(time){callback_activityTime(time); },
        callback_finished_sending:     function(time){ callback_finished_sending() },
        swf_path : 'JS/jRecorder.swf',
     }
   );   
</script>

Open in new window


PHP Codes (works)

 <?php
       if(!isset($_REQUEST['filename']))
       {
         exit('No file');
       }
       $upload_path = dirname(__FILE__). '/';
       $filename = $_REQUEST['filename'];
       $fp = fopen($upload_path."/".$filename.".wav", "wb");
       fwrite($fp, file_get_contents('php://input'));
       fclose($fp);
       exit('done'); 
    ?>

Open in new window

My codes that I trying

set xmlhttp = Server.CreateObject("Msxml2.ServerXMLHTTP.6.0") 
xmlhttp.open "GET", ???? , false 
xmlhttp.send
With Server.CreateObject("Adodb.Stream")
    .Type = 1 '1 for binary stream
    .Open
    .Write xmlhttp.responseBody
    .SaveToFile Server.Mappath("data/hello.wav"), 2 ' 2 for overwrite
    .Close
End With
set xmlhttp = nothing 

Open in new window

0
Hi
I am new in angularJS.
i am working with classic asp and angularJS.
when i call http post method to classic asp page in angularJS  its send data to classic asp page. but when i am try to retrieve posted data on classic asp page i found nothing?

is there i am doing wrong?

here is my code sample

----------Html code---------------
<div ng-app="CallSiteVisitor" ng-controller="SessionAndVisitor">
<form ng-submit="SaveData()" >
<input type="text" ng-model="form.firstname">
<input type="text" ng-model="form.lastname">
<input type="submit">
</form>
</div>
---------Html code end----------

-----------Controller code ------------
var app = angular.module('CallSiteVisitor', ['fm']);
      app.controller('SessionAndVisitor', function($scope, $http) {

$scope.form = {};
        $scope.SaveData = function() {
                  $http({
                    method  : 'POST',
                    url     : 'http://www.xyz.com/action_contactformAJ.asp',
                    data    : $scope.form,
                    headers : { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' }
                   })
                    .success(function(data) {
                        if (data.errors) {
                                        // error code
                        } else {
                         // data code
                        }
                    });
                  };
      });
-----------Controller  code end---------


---------- Classic asp page code (action_contactformAJ.asp)-------------------------
<%
Response.write request("FirstName") & "  " & request("LastName")
' here i found null value but when i see in browser by pressing …
0
Hi
I am new in angularJS.
i am working with classic asp and angularJS.
when i call http post method to classic asp page in angularJS  its send data to classic asp page. but when i am try to retrieve posted data on classic asp page i found nothing?

is there i am doing wrong?

here is my code sample

----------Html code---------------
<div ng-app="CallSiteVisitor" ng-controller="SessionAndVisitor">
<form ng-submit="SaveData()" >
<input type="text" ng-model="form.firstname">
<input type="text" ng-model="form.lastname">
<input type="submit">
</form>
</div>
---------Html code end----------

-----------Controller code ------------
var app = angular.module('CallSiteVisitor', ['fm']);
      app.controller('SessionAndVisitor', function($scope, $http) {

$scope.form = {};
        $scope.SaveData = function() {
                  $http({
                    method  : 'POST',
                    url     : 'http://www.xyz.com/action_contactformAJ.asp',
                    data    : $scope.form,
                    headers : { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' }
                   })
                    .success(function(data) {
                        if (data.errors) {
                                        // error code
                        } else {
                         // data code
                        }
                    });
                  };
      });
-----------Controller  code end---------


---------- Classic asp page code (action_contactformAJ.asp)-------------------------
<%
Response.write request("FirstName") & "  " & request("LastName")
' here i found null value but when i see in browser by pressing …
0
Hello every 1.

To finish a cost analysis for a concept, i want to make an list for an IT server Infrastructure / Architecture for a e-commerce website. For days now I am surfing the internet to find a small pieces of information.

Hyper Converged Infrastructure / hardware for server
Below a list of what I have found so far on the internet for the composition of a hyperscale computing environment setup on which everything should run.
This server system must function with open source technologies and support open innovation.

Usable Servers
Fileserver (FTP) -
Mailserver (Microsoft exchange) -
Printserver -
Log In server Printserver -
Back up Server -
Media |Server (videos + Photographs),
Application server (software developed locally)
Webserver / Virtualisation server  (Nginx)
Webserver
Webserver
Economic server
Test server
Databaseserver (Microsoft SQL and Mongo DB)
Collaboration Server (Microsoft Sharepoint)
Host connectivity


Local Area Network in company
- VPN server
- DNS server
- DHCP server
- Virus scan  / Wsus server
- Wide Air Networks (WAN) SD-WAN+VPN+L2 encryption
- Network SLAs -
- Extranet - External Acces Portals
- Intranet - Internal Acces Portals
- Switches, -
- Acces points,
- modems, routers,
- firewalls  NextGen FW + Inet DDos subscription
- Router
- Fiber optic cabels
- UPS powersupplies

The system must be able to process around 8 million visitors a month, and 2 …
1
I had this question after viewing Classic ASP - Using Response.Redirect with parameters (or anchor).

I am now working on a similar classic ASP page, and all is working well. The redirect after form completion works fine, and redirects to the same page as the form is on, and to the correct position, because of the anchor.

There are two pages : viewstudent.asp (the main page) and updatediary.asp. The form is contained in viewstudent.asp, and the form action happens on updatediary.asp, and the last line of code in updatediary.asp redirects back to viewstudent.asp :

Response.Redirect("viewstudent.asp?id=" & getSchoolID & "#DataEntryTest")

Open in new window


All good so far.

Now, I have changed the design a little bit, so that the main page viewstudent.asp now has 3 tabs, with the tab1 showing as default when the page loads initially.

This is done with a simple javascript function. The problem now is that when the form (which is on tab2) is submitted  , the redirect (with anchor) does not work, because of the default loading of tab1. It should (I want it to) redirect to tab2, where the form is.

I wondered if there was any way to override this, possibly by adding a tab-id to the response.redirect statement, eg something like :

Response.Redirect("viewstudent.asp?id=" & getSchoolID & "#EnterVisit" & tab-id=2)

Open in new window

 

Is this possible? I have searched the web for an answer, but all the answers are for "tab" (meaning a new browser tab), and not a set of tabs on a single page.

This is the tabs code :


Open in new window

0
0
Converting a classic ASP site to run on Windows Server 2012 R2. The site makes extensive use of custm HTML meta tags and Index Server to achieve many different results. Windows Server 2012 does not have Index Server and it seems the recommended replacement to use is Windows Search service. I can modify my queries on the search catalog to find standard information such as title, filename etc. The problem is I can't figure out how to add my custom meta tags to the catalog and then be able to search for them on the ASP pages.

So I need to know two things: how to ad the custom tags to the search catalog/index and then how to search for them via classic ASP code.
0
I'm using the well know function below.. I receive the payload, split the string, and sometimes it works, sometimes it does not.

I take the same  string I am trying to decrypt, and try in javascript, and it decrypts it (jwt.io) ... I have been scratching my head for 2 days trying to figure out what the issue is.. I get the error "Error parsing [BigLongBASE54stringGoesHere] as bin.base64 datatype"

If I snip off the last 2-4 characters it process it, but removes the trailing "}" unencoded response.... about 1/2 of the return payloads act like this.

Function Base64Decode(ByVal vCode)
    Dim oXML, oNode
    Set oXML = CreateObject("Msxml2.DOMDocument.3.0")
    Set oNode = oXML.CreateElement("base64")
    oNode.dataType = "bin.base64"
    oNode.text = vCode
    Base64Decode = Stream_BinaryToString(oNode.nodeTypedValue)
    Set oNode = Nothing
    Set oXML = Nothing
End Function
0
Hi there, I have been looking for some code to use with click and enlarge of images, however...

All the code I have found opens a new window (of the browser) which the user would have to click to close...

I have prob the wrong wording, and do not know the correct.

What I am looking for is the image is enlarged over the top of it (not within the page itself)

a good example is:
https://www.gootickets.com/en/7-formula-1/10801-azerbaijan/?affid=3672&pgs=91

another good example is when you click the link button above

Is anyone able to help me find the right code or suggest where I can find it?
0
Get your problem seen by more experts
LVL 12
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

w3socketc.dll can work both vb, asp and php? Could anyone  replay me. I need it badly.
There is a server and I need to socket connection and give some command and get output from there. Now it is connected w3sockets.dll vie VB. I wants to convert it to php but I am stacked at connection stage. Only telnet is enable there. Please help me regards this issue.
0
how do I get moments.js to output to asp classic variable  e.g <%=mytimeORsomthing %>
0
dim rs
dim user1
dim pass1
dim role
dim strsql

set rs=server.CreateObject("ADODB.Recordset")

if session("user")="" then
      Response.Redirect "loginpage.asp"
end if




'Response.Write session("user")
strsql="select granted_role from user_role_privs"
rs.Open strsql,Session("conn")
role=rs.Fields(0)
rs.Close()
set rs=nothing
'-----------for war alert...-----------

if session("user")="ADMINISTRATOR" or role="CSG_ROLE"  then
            
            
            set rs=server.CreateObject("ADODB.Recordset")
            strsql="select WARRANTY_DT,asset_no from tabasset where WARRANTY_DT<=(sysdate+90) and WARRANTY_DT>=(sysdate-30)"
            rs.Open strsql,session("conn"),3 ( Shows Error in this line)
            'Response.Write rs.Fields(0)
            if not rs.EOF then%>
0
I have a web site that uses an Excel 2007 spreadsheet to store information for displaying new pages when buttons are clicked.  It has been function for more than a year with the following connection information

mystring="Driver={Microsoft Excel Driver (*.xls)};"
mystring=mystring & "DriverId=790;Dbq="& Server.MapPath("2012_SimplifiedItemsForSale.xls")

This now fails with the following error message:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Excel Driver] Reserved error (-5016); there is no message for this error

Searching the web, I found that many people have seen this error, and the recommendation is to use a different OLEDB driver.

I downloaded and installed AccessDatabaseEngine from Microsoft site and changed the code to the following:

mystring="Provider=[Microsoft.ACE.OLEDB.16.0]"
mystring=mystring & Server.MapPath("2012_SimplifiedItemsForSale.xls")

The new error code is:

ADODB.Connection error '800a0e7a'
Provider cannot be found. It may not be properly installed

Q1.  Can anyone tell me if I have properly written the code to use the new OLEDB?
Q2.  Is there another step that must be taken to be able to use the driver software?

Office 2007 is installed in c:\Program Files (x86)

Help. Please.
0
i wanna knowing to run asp pages without IIS or PWS
0
Hi, is it possible to sort xml data in a classic asp page using AJAX and querystrings??

xml code

<?xml version="1.0" standalone="yes"?>
<DocumentElement>
<Data>
<EnsembleID>23331</EnsembleID>
<BookCode>NWP-MV</BookCode>
<Issue>Aeon Financial 2019</Issue>
<LongBLPTicker>QZ3838484 Corp</LongBLPTicker>
<ShortBLPTicker>8570 JT Equity</ShortBLPTicker>
<LongPos></LongPos>
<StubPos>600000000</StubPos>
<SIV>0.927</SIV>
<Parity>91.95</Parity>
<Premium>0.173</Premium>
<IV>99.23</IV>
<LongPx>107.81</LongPx>
<PxChg>0.05</PxChg>
<TheoChg>0.03753</TheoChg>
<StubPrice>8.59</StubPrice>
<ShPxChgPer>0.001277</ShPxChgPer>
<SLH>0.009</SLH>
<CurDelta>0.32</CurDelta>
<ImpDelta>0.444</ImpDelta>
<TheoDelta>0.417</TheoDelta>
<FutHdg1>-14.13</FutHdg1>
<ImpVolCB>0.242</ImpVolCB>
<ImpVolStub>0.242</ImpVolStub>
<V90D>0.198</V90D>
<DPnL>0.4</DPnL>
<WPnL>3</WPnL>
<MPnL>1.2</MPnL>
<YPnL>-4.9</YPnL>
<NetPnL>16.8</NetPnL>
<DayTE>-0.1647</DayTE>
</Data>

Open in new window




Page code...


<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Summary</title>
<style>
table {
    border-collapse: collapse;
    width: 100%;
}

th, td {
	font-family:Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;
    text-align: left;
    padding: 8px;
}
tr:nth-child(odd){
	font-family:Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size:10px;
	background-color: #eef6ff
	}
tr:nth-child(even){
	font-family:Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size:10px;
	

Open in new window

0

ASPSponsored by Flatiron School

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.