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;

OK, I need to count some numbers, and if the number matches, then assign that number to the folder.

This is the Image folders. (yes, the X is in the name of the folders)
000XXXXX
001XXXXX
002XXXXX
003XXXXX
004XXXXX
005XXXXX
006XXXXX
007XXXXX
008XXXXX
009XXXXX
01XXXXXX
02XXXXXX
03XXXXXX
04XXXXXX
05XXXXXX
06XXXXXX
07XXXXXX
08XXXXXX
09XXXXXX
1XXXXXXX
2XXXXXXX
3XXXXXXX
4XXXXXXX
5XXXXXXX
6XXXXXXX
7XXXXXXX
9XXXXXXX

Open in new window


These are some sample of the images, corresponding with their folder names.
001XXXXX
00100000.jpg
00101934.jpg
00103153.jpg
00199013.jpg

Open in new window

002XXXXX
00202549.jpg
00287068.jpg
00298070.jpg

Open in new window

09XXXXXX
09970234.jpg
09971079.jpg
09971795.jpg

Open in new window

1XXXXXXX
13523105.jpg
14002020.jpg
14050044.jpg
14050054.jpg

Open in new window


This will get the number of leading 0s.
<%strCLID = "00102348"%>
<%getCount = len(strCLID)-len(clng(strCLID)) &"-"& strCLID%>
getCount = 2

Open in new window


And for the long number: 14050054
The result is
-1

So, it would need to be something like this.

<%
if strNum="13523105" then
getFolder = "1XXXXXXX"
elseif strNum="03523105 then
getFolder = "03XXXXXX"
if strNum="93523105" then
getFolder = "9XXXXXXX"
if strNum="00523105" then
getFolder = "00XXXXXX"
elseif ......etc...
%>
This will be used in the image link
<img src="graph/item/<%=getFoldre%>/<%=getImage%>" />

Open in new window


Any ideas on this one?

Thanks, All
Carrzkiss
0
Cloud Class® Course: Microsoft Windows 7 Basic
LVL 12
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

Hi EE Brainstrust,

I would like to do something like this however, cannot seem to make it work

If Request.QueryString("departure")>0 Then
	Set CatProdDep=oConn.Execute("SELECT * FROM prods,prod_deps WHERE prods.brand_ID='"&SubDomain("sites.brand_ID")&"' AND prods.prod_ID="&Request.QueryString("product"))
ElseIf Request.QueryString("product")>0 Then
	Set CatProdDep=oConn.Execute("SELECT * FROM prods,prod_deps WHERE prods.brand_ID='"&SubDomain("sites.brand_ID")&"' AND prods.prod_ID=prod_deps.prod_ID AND (dep_date>Now() OR ISNULL(dep_date)) AND prod_live=TRUE AND dep_live=TRUE AND prods.prod_ID="&Request.QueryString("product")&" ORDER BY dep_date")			
ElseIf Request.QueryString("category")>0 Then
	Set CatProdDep=oConn.Execute("SELECT * FROM prods,prod_deps WHERE prods.brand_ID='"&SubDomain("sites.brand_ID")&"' AND prods.prod_ID=prod_deps.prod_ID AND (dep_date>Now() OR ISNULL(dep_date)) AND prod_live=TRUE AND dep_live=TRUE AND (prod_type="&Request.QueryString("Category")&" OR dep_type="&Request.QueryString("Category")&") ORDER BY dep_date")
	Do Until CatProdDep.EOF		
End If

Response.Write("Data here<br>")

If Request.QueryString("departure")>0 Then
	response.write("departure")

ElseIf Request.QueryString("product")>0 Or Request.QueryString("category")>0 Then
	CatProdDep.MoveNext
		Loop	
End If

Open in new window


The Statements work in singular, pulled out of the IF statement, however I want to use a format that would be intricate and identical for all 3

If there a way to use it like this, but a different way to show it or is not possible?
0
I have an ASP page that connect to 3 different excel workbooks and pulls specific data from each and then dispays the results by user location. what I need to do now it make it so if there is something that has been labled as "open", which is one of the fields I pull from one of the spreadsheets I need the user to be able to click a link that will carry all the data from that particular row over to another page that will allow them to add a comment as to why the action is still open. once they enter a comment it would then take the row of information including the newly added comment and write it to an access database . The writing to the database part is easy, I can handle that but the getting the data from the first .asp page to the other is the part I am lost on.

This is the code from the header part of the page
<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
		
		
		

Open in new window

0
I’m using a script in asp to send email via CDOSYS. Works well but I’m sending in “from” with a hotmail address that has the name of the person perfectly configured inside hotmail details. Now when the mail arrives in the name of the from appears perfect the email address but the name changes like strange things that is not the name configured in hotmail details. For example a name of a person sometimes is vitamin, matchs, and so on... Why arrives like that (changing to strange things) the name of the persons on the hotmail from email?

For example I have a text like this:

to: anyemail@gmail.com
from: otheremail@hotmail.com
subject:This is a test. 

This is a final test

. 

Open in new window


On that txt Imcopy to pickup on IIs dir and how can Imforce to send a name on the from and also on cdosys?
0
I have 4 variables which they contain some values.

I have already convert them in numbers with CDbl.

So I have something like that:

var1=CDbl(str1)
var2=CDbl(str2)
var3=CDbl(str3)
var4=CDbl(str4)

Open in new window


How can I find the smallest number between var1, var2, var3 and var4?
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
I am using a URL Rewrite, and have opted to use the title of the articles, as the URL.
Since the design of the site, of which was done back in 2014, I prepared the title to be used in this way.

NOW, the issue is this.
some of the articles have commas in the title.
So, the URL looks something like this.

/KISS_Concert_(Jan_10,_1985)

With a comma after the 10.

How can I pass this to my Query?
As of right now, it breaks at the comma.
So, it only sends to the page.

/KISS_Concert_(Jan_10

I have searched and have come up with nothing.
The only thing I can find is using:

%2C
/KISS_Concert_(Jan_10%2C_1985)

However, it still cuts off after the 10 in the name.

The only other option is to create a new column in the table, for the URL, and have it without a comma.
And leave the title as is, with the comma.
However, if there is a way, of which, there should be.
Heck, Microsoft has commas in their URLs, so we should be able to accomplish the same thing as well.
0
I have this code to send cdosys using windows server:

<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<META http-equiv="Pragma" CONTENT="no-cache">




<title>Message sent</title>
<style type="text/css">
<!--
.BotonExit2 {
	color: #FFFFFF;
	background-color: #FF0000;
}
-->
</style>
</head>

<body> 

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> 
<%
DIM strEmail
strEmail = Request.Form("Email")
IF strEmail <> "" AND inStr(strEmail,"@") <> 0 AND inStr(strEmail,".") <> 0 THEN



'First lets Dim all the variables we need

Dim emailfromr 

Dim email

Dim name

Dim message

Dim company

Dim telephone

Dim address1

Dim city

Dim state

Dim zip

Dim users

Dim app_name

Dim decision_time

Dim OS

Dim bandwidth

Dim DedicatedFirewall

Dim TapeBackup

Dim special_details

Dim MyBody

Dim MyMail

Dim MyEmail

Dim SmtpMail

Dim racecn

Dim cn
 

'Now lets get some values for the variables from the form

smtpserver = "127.0.0.1"

youremail = "myemailto@gmail.com"

yourpassword = "ADDYOURPASSWORD"

email = Request.Form("email")

emailfromr = "info@ourcompany.com"

If email = "" then email ="Invalid Mail"

name = Request.Form("name")

message = Request.Form("message")

company = Request.Form("company")

telephone = Request.Form("telephone")

address = Request.Form("address")

city = Request.Form("city")

state = Request.Form("state")

zip = Request.Form("zip")

users = Request.Form("users")

app_name = Request.Form("app_name")

decision_time = 

Open in new window

0
I cannot figure out a Zero-String error on my web page. I am using an Access database for my Table and the Web page is an ASP page.
Below is the error message along with the line of code for the desired records. In the code, how do I correct the 'City" field.?
If the user does not enter anything in the field, the field should respond with a blank display.

Thank you for any help!
Rick

ERROR
insert into CAR (EditBy,Status,DateIssued,[Issued by],Title,Company,Contact,Phone,Fax,Email,Manufacturer,[Part Number],[ESC ID],PO,RMA,[Quantities Affected],[Description of Nonconformance],Containment,[Root Cause],CandP,[Corrective Action Date],[Due Date],[Reference Number],Address1,Address2,City,State,Zip,CityStateZip,Quan1,Lot1,Quan2,Lot2,Quan3,Lot3,Branch,ClosedDate,CompletedBy,ToFrom,ReviewOfEffectiveness) values ('BECKYS','Closed',NULL,'BECKYS','','','','','','','','','','','','','','','','',NULL,NULL,'','','','','','','','','','','','','','',NULL,'BECKYS','From: ES Components',NULL)
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver] Field 'CAR.City' cannot be a zero-length string.
/AllCARAdds.asp, line 79

CODE
var MM_fieldsStr = …
0
Cloud Class® Course: C++ 11 Fundamentals
LVL 12
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

We are using the script below to redirect users who have Safari. Which our software does not support.
The script works perfectly on Mac OS computers and PC, but it redirects everyone when using ipad or iphone regardless to the fact they are using Firefox or Chrome.
How can we fix it so that it does not redirect on ipad/iphone unless they are using Safari?

function getBrowserName() {
    var name = "Unknown";
    if(navigator.userAgent.indexOf("MSIE")!=-1){
        name = "MSIE";
    }
    else if(navigator.userAgent.indexOf("Firefox")!=-1){
        name = "Firefox";
    }
    else if(navigator.userAgent.indexOf("Opera")!=-1){
        name = "Opera";
    }
    else if(navigator.userAgent.indexOf("Chrome") != -1){
        name = "Chrome";
    }
    else if(navigator.userAgent.indexOf("Safari")!=-1){
        window.location.href = "notsupported.html"
    }
    return name;   
}

if( getBrowserName() == "Safari" ){
    window.location.href = "notsupported.html";
}else{
   
}

Open in new window

0
I'm trying to set up an old website on my local windows 10 machine!
I've setup IIS and added the classic ASP module and If I use non database ASP pages
it works fine.  I've installed MySQL and setup ODBC with the proper driver and can access and test
the database fine!  
Its when I try access the database via ASP that it fails! The code I'm using worked fine on the web server.

This is the code that gives the error!
   
     Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
     Recordset1_cmd.ActiveConnection = "DSN=netcode;UID=peter;PSW=1234;"    *** This is the line that fails ***

I've also modified the read/write permissions on the INETPUB folder and all subfolders to full control!
And have modifier the users to full control as well!  

thanks

Pete
0
Hi Experts, I wish to obtain all Tables that is inside my database. I want to get their names and put it in the table. I have code below but I have no idea how do it. I have DataBase named, "MyDataBase"

<%

response.expires=-1

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

cn.ConnectionString = "driver={SQL Server};server=MyNoteBook\SQLEXPRESS;uid=sa;pwd=sa;database=" & "MyDataBase" & ""
cn.Open

%>

Open in new window

0
Using Classic ASP, is there a reliable way to redirect a user to another page on load if the user is using Safari?
0
We are having an issue when using ASPUpload (http://www.aspupload.com/) and a Network Drive plugged into a VM Azure Server

If we point our application (Classic ASP) to point to a computer drive (C:) for example, it will find it and upload documents without any issues.
If we point the path to be a Storage File Drive (Z://) says it can't find it. We read some and found that the path had to the something like this:

\\ourstorage.file.core.windows.net\ourfileshare

But the site says it cannot find the path with either Z or the path above.
After reading some documentation we found that we needed to add the line below, which we did then we get a 'username and password incorrect' Even though they are the correct ones. I tested by typing the path in windows explorer then entering the credentials.

upload.LogonUser "", "username", "password"

Anyone with experience doing this will be greatly appreciated.
0
I am trying to redirect the following:

http://ppr/tax:81/tabular.asp to
response.Redirect("https://taxcom.grwr.gov/ppr/tabular.asp")

However, what we would like to display is:
https://ppr/tax:81/tabular.asp

Is this possible.

For more clarity, ("https://taxcom.grwr.gov is a subdomain and
http://ppr/tax:81/tabular.asp is another subdomain

But because http://ppr/tax:81/tabular.asp is does not have its dedicated ssl certificate, we would like it to  inherit the certificate from https://taxcom.grwr.gov but replace taxcom with ppr.

Is this possible?

Hope this makes sense.

Thanks in advance
0
I am using the following select statement that works.  (See below) Is there a way to insert in the code a line space after the group by so that there is an actual space?

The code currently yields this result:       ABC     Tom
                                                                        ABC      Harry
                                                                        ABC      John
                                                                        DEF      Paul
                                                                        DEF      Bill
                                                                        DEF       Pete

Can the code yield this result??                 ABC     Tom
                                                                        ABC      Harry
                                                                        ABC       John

                                                                        DEF     Paul
                                                                         DEF    Bill
                                                                         DEF    Pete    
SELECT Field10,Field3, SUM(Field16) as SumofField16
FROM EmailHistoryTotalSalesLineAllCustomers
WHERE (Field6 BETWEEN #varStartRange# AND #varEndRange#)  GROUP BY Field10,Field3
ORDER BY SUM(Field16) DESC
0
I am working on a signature app that needs to save a copy of the signature as an image on the server. I am using asp.net and visual studio. The javascript I am using will give me a dataurl, but I need to be able to save this as an image on the server. I want to capture the current date and time of the signature as the filename, and be able to save a record of this filename to a column of one of my SQLtables so that I can associate the image with the customer in question. What is the best way to accomplish this? I am still somewhat new to javascript so a step-by-step or an example would be very helpful. If I get the dataurl to a serverside control then I do know how to save it, but because it is javascript/ client side I am stuck. Below is part of the script I am using which shows where I have gotten so far in getting the dataurl:

<script type="text/javascript">
$(document).ready(function() {
    var signaturePad = new SignaturePad(document.getElementById('signature-pad'), {
        backgroundColor: 'rgba(255, 255, 255, 0)',
        penColor: 'rgb(0, 0, 0)'
    });
    var saveButton = document.getElementById('save');
    var cancelButton = document.getElementById('clear');

    saveButton.addEventListener('click', function (event) {
        var dataurl = signaturePad.toDataURL('image/png');

        // Save image to server or pass dataurl to server-side control.

    });
    cancelButton.addEventListener('click', function (event) {
        …
0
I have a MVC 5 project and a few older ASPX pages i would like to link from an MVC page. Is there any way to add the ASPX files to the existing MVC project? Can I just put all the files from both MVC and the aspx files on iis and just call the aspx page from a html link?

Thank you for any help you can give
0
Free Tool: SSL Checker
LVL 12
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Where can I find a good third party tool to write cgi, asp, vb, c sharp scripts?
0
Is there a way to subtract 1 day from the date using SQL in this scenario?

FirstMonth = 2018-01-31
SecondMonth = 2018-02-02

conn.open "select * FROM [ExportSales].[dbo].[Transaction_report_3-8-2018v2] WHERE Category = 'Sales' AND cast(Date as Date) > ('" & (FirstMonth) & "' ) AND cast(Date as Date) < '" & (SecondMonth) & "' ORDER BY Date ASC", "DSN=sales"

Open in new window

0
I'm using the following to display numbers from an xml in an asp page

For Each xmlNode In objXML.documentElement.selectNodes("Data[FundCode/text()='" & neaFundID & "']")

NEADayPnL = xmlNode.selectSingleNode("DayPnL").text

Next

***then im creating a recordset to load up the data ***

Set objRsBC  = CreateObject("ADODB.recordset")

            objRsBC.Fields.Append "NNWDayPnL", adVarChar, 100


objRsBC.open, , 2, 3
      objRsBC.AddNew
                  objRsBC.Fields("NNWDayPnL") = NNWDayPnL

then I'm calling  a function to display the number...

<%call vbproc(objRsBC("NNWSLDayPnL"), objRsBC("NNWSLDayPnL").name)%>



seems long winded, how would I select a single node and display the number with out creating a record set etc...

Thanks
0
When I run this query it works fine:

/****** Script for SelectTopNRows command from SSMS  ******/
SELECT TOP 1000 [ProductId]
      ,[Title]
      ,[Created]
  FROM [DAL.ProductContext].[dbo].[Products]
  WHERE Created LIKE '%2018%'

Open in new window

When I run this, it returns 0 rows.  What am I doing wrong? Why is the dash causing problems?
(FYI, there are rows with that date)

/****** Script for SelectTopNRows command from SSMS  ******/
SELECT TOP 1000 [ProductId]
      ,[Title]
      ,[Created]
  FROM [DAL.ProductContext].[dbo].[Products]
  WHERE Created LIKE '%2018-03-07%'

Open in new window

The date field is Created (datetime, not null)
0
I have an hsphere  hosting account on a shared windows server, and I am trying to clean up the files. I see that in 2014 the server was "attacked" and someone deposited many html and ASP files related to spam/malware. I am using FileZilla and trying to delete them, but I get the error :

Command:      DELE shop-celine-handbags-99.jpg
Response:      550 Access is denied.

I can't adjust the permissions on the site because it is a Windows server:

Command:      SITE CHMOD 777 shop-celine-handbags-99.jpg
Response:      500 'SITE': command not understood

I don't have a file manager on the hosting site - it was removed due to "security concerns"

Any suggestions on how to delete the files?

(I don't want to ask the hosting company yet, as I have been "bothering" them a bit too much during the past two days)
0
I need to do an audit of my inventory.  I want to write a report that shows how much is in each box (b408 used in the example below). That will give us an idea where there is free space to add new inventory to.

I know how to do a quick check of what is in each box, like below:
conn.open "SELECT * FROM [DAL.ProductContext].[dbo].[Products] WHERE QuantityAvailable > '0' AND (Location LIKE 'b408%') ORDER BY Created ASC;", "DSN=dashboard"
do while not conn.eof
quantitycounter = quantitycounter+ 1
Location = 	conn("Location")
conn.moveNext
loop
<% = (TotalQuantity) %> Items / <% = (quantitycounter) %> SKUs

Open in new window

But if I run through that same code for each box of inventory, on the same ASP page, the code is going to get really messy, and LONG.

Can one of the experts point me in a better direction to start?
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.

Top Experts In
ASP
<
Monthly
>