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 an ASP page where I am using vbscript to add records to an access database and that is working well, however I only want to add the records if there has been no entry for that day. The access table has a field called EntryDate and its default value if the short date so I was wanting to use this field to determine if anything had been written to the database on the current day based on this. Below is the code that adds the record.

<%
	
		sql = "Select * FROM tblData;"
		
        'set OpARS = server.createobject("adodb.recordset")
		OpARS.open sql,dbAConn,adopenkeyset,adlockoptimistic

'Server Side form validation to keep our database clean
dim Site, Availability, Reliability, Efficiency, NminusXST, ProdctLoss, MoneyLoss, Comments

User = vFullName

'If we pass through validation then store the information in the db

OpARs.AddNew
OpARs("User") = User
OpARs("Site") = Site
OpARs("Availability") = Availability
OpARs("Reliability") = Reliability
OpARs("Efficiency") = EffSite
OpARs("NminusXST") = NminusXST
OpARs("ProductLoss") = ProductLoss
OpARs("MoneyLoss") = MoneyLoss

OpARs.update
RecID = OpARs("ID")


%>

Open in new window


was thinking if using something like IF NOT EXISTS(Select * FROM tblData WHERE EntryDate < Date();)
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

Hi Experts,
I am submitting Username and Password to a database table with Classic ASP. This is my form:
<form name="form" method="post" action="Passwords_send.asp">
Username: <input name="Username" type="text" id="Username" /><br />
Password: <input name="Password" type="text" id="Username" /><br />
<input type="submit" name="Submit" value="Submit" />
</form>

Open in new window

Below is the code that sends the Username and Password to the database:
<!-- #include virtual="/Connections/SQLConn.asp" -->
<%
strUsername = request.Form("Username")
strPassword = request.Form("Password")


'create connection object
Set MesIns=CreateObject("ADODB.Command")
MesIns.ActiveConnection=conn
MesIns.commandtext = "insert into Login (Username, Password) VALUES (?,?)"
MesIns.Parameters.Append MesIns.CreateParameter("@Username", 200, 1, 999, strUsername)
MesIns.Parameters.Append MesIns.CreateParameter("@Password", 200, 1, 255, strPassword)

MesIns.Execute

Response.Redirect "Passwords.asp"

conn.Close()
Set conn = Nothing
%>

Open in new window

I would like the Username and Password be encrypted. How can I achieve this?
Thank you for your help.
0
I have a classic ASP page that grabs data from 4 different excel sheets and displays them in a table. what I want to do is since I am pulling pieces of data from 4 different sources I would like to then take the consolidated pieces of data and as it is loaded to this ASP page, also add it to a Access table so i then will have a single source for this particular data. the make up of the ASP page is as follows:
Each row of data in this ASP is placed into a <form name="Form1"> </form><form name="Form2"></form> and so on all the way to form11. so what I have tried to do is at the beginning of the page before the <html> tag i have all my connection strings to each of the excel sheets and this one for the access database:
vMdbFile = Server.MapPath("/virtual/data/BusinessDash.accdb")
	vConnStr = "Provider=Microsoft.Ace.OLEDB.12.0;Persist Security info=False;Data Source=" & vMdbFile	

		'Open Database Connection
		Set dbAConn = Server.CreateObject("ADODB.Connection")
		dbAConn.Open vConnStr
		
	
	
		set OpARS = server.createobject("adodb.recordset")

Open in new window




then down in each of the <form> tags just before the </form> tag so it is after all the other data is pulled from the excels I have:
<%
	
		sql = "Select * FROM tblData;"
        'set OpARS = server.createobject("adodb.recordset")
		OpARS.open sql,dbAConn,adopenkeyset,adlockoptimistic


dim Site, Availability, Reliability, Efficiency, NminusXST, ProdctLoss, MoneyLoss, Comments

User = vFullName
Site = 

Open in new window

0
I want to show a modal popup button when regular asp button clicked.   using vb.net .....Help!!

Sample below:
asp button
 <asp:Button ID="extButton" runat="server" Enabled="False" Visible="false" Text="Click to Invite External" /></button>

Open in new window


-- popover button hidden until this button active and clicked

<div style="text-align:center; margin-top:10%">

<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#demoModal" id="">Click to enter Extended Client Name</button></button>

</div>

Open in new window


- This button will appear ready to show modal content

Modal Function
<script type="text/javascript">

        $(function () {

            $("#btnShow").click(function () {

                $('#demoModal').modal('show');

            });

        });

</script>

Open in new window

0
I am having a hard time creating a site map with https://www.gopherstateevents.com/  Could it be because I have several pages (including the home page) that were made with Mobirise and the rest are classic asp pages?  I've tried several online xml site map creators and none seem to be working for me.
0
I am in the process of migrating some classic ASP applications from Windows Server 2003 to Windows server 2012.

I have managed to get a basic ASP page to run - however when I try and run a page that access's an SQL database I get this error:

error '80004005'
/apps/Retail_Helpdesk/frames/frameoverall.asp, line 17


Line 17 refers to the database connection in my code:

Classic ASP Error
I have setup the ODBC connection to the database and have tested it - it works ok.


I am hoping that someone will know a way of fixing this one.

Thanks

stuart
0
I have a select that concatenates 3 fields and adds a space between the first name, middle name and last name.

The problem is if there is no middle name then 'fullname' ends up with two spaces between the first and last name. How can I avoid this?

This is my select statement:

CONCAT(ISNULL (a.FirstNm, ''), ' ', ISNULL (a.MiddleNm, ''), ' ', ISNULL (a.LastNm, ''))  AS fullname,  

Open in new window


The space should only be removed if there is no middle name, otherwise there should be space between first, middle and middle last.
0
Experts - My client has 2 websites (intranet). 1 is written in classic asp and the other in .Net.

.Net web application is 2 factor authentication enabled. The same has been set in web.config under App settings.

Now, the client wants to enable 2 factor authentication in Classic asp web application too. I understand its Old tech and should advise the client to go to .Net. However its a no go from client.

Can someone help get this done please?
1. How do i enable classic asp web application to be 2 factor authentication? (First at https://login.microsoftonline.com/ and then "PingID" as second Auth)
2. Currently it is connected to SQL server and "Connection.asp" has all the connection strings in it.

Please help.
0
Hi there.

I'm still working on a conversion of a MySQL based web database to MS SQL Server, and I have a little issue. In MySQL I could save NULL to a date variable, and it would show nothing in the web interface and back-end. But in MS SQL if I save a NULL (simply no value - NULL allowed) is still saves the date 01-01-1900. Is it possible to avoid that? If no date is saved, nothing should show up.
I use asp/VB.

Best regards

Ulrich
0
Hi

I am designing an online SQL database for ordering products on my ASP.net web app.
I am trying to work out the best way to handle the "Basket".
The easiest way in my mind would be to retain the IDs of the items that
a user selects using cookies so that if the user leaves the page and comes
back I can use the cookies to show which items were selected.

An alternative option would be to have a SQL table that is structured
like my Products table. I would insert the user's selected items into this table.

I could also use my Orders table and show the Order status as being in the basket.


I'm looking for a little feedback on this. Thanks
0
Keep up with what's happening at Experts Exchange!
LVL 12
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

I have a legacy site that I need to set up some emails using a pickup directory.  I have read that I need to use an include file like I do for the connection strings instead of a web.config.

The email code on my Classic ASP page is simple:
<%
      Dim EmailDocument
      Dim strMessage
      Dim iConf
      Dim Flds
      
      Const cdoSendUsingPickup = 1
      
      strMessage = "My Message goes here"

      Set EmailDocument=CreateObject("CDO.Message")
      set iConf = CreateObject("CDO.Configuration")
      Set Flds = iConf.Fields
      
      With Flds
            .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPickup
            .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "path to my pickup directory"
            .Update
      End With
      
      With EmailDocument
            Set .Configuration = iConf
            .To=EmailList      
            .From = "From Email Address"
            .Cc =strAddEmailAddress
            .Bcc = strAltEmailAddress
            .Subject = "Subject goes here"
            .TextBody = strMessage
            .Send
      End With
      
        Set EmailDocument = Nothing
      Set strMessage = Nothing
      Set iConf = Nothing
      Set Flds = Nothing
%>

I'm assuming I would add an include file like this:
<!--#include file="includes/Functions.asp" -->

What I don't know is the code I need to add to the actual include file.  The web.config would look like this:

<mailSettings>
                   <smtp deliveryMethod="SpecifiedPickupDirectory">
                    <specifiedPickupDirectory pickupDirectoryLocation="Path to my pickup directory" />
               </smtp>…
0
.net MVC  or  .net core?

We currently have a web application developed in ASP Classic.
The application is hosted in Microsoft Azure and we use Azure's SQL servers as well as the back-end.

We are still to decide if we move the application and use .net MVC or .net CORE?
I am not too familiar with the pros vs cons.  If there is a website with more information on comparing the two would be great.

I also understand CORE is newer and may not be as mature, do you consider this to be a significant problem?  Moving the system will take about 1 year.
we are using a Bootstrap 'template', AJAX, JSON, XML, etc.

Another thing to consider is that I downloaded Visual Studio in my mac. It would be great if I could check the code there and test the system in the mac computer.
I guess the challenge there will be to connect to our Development Database in Azure.

Any help, guidance, tips and especially comparison would be very useful. I know that sometimes its a matter of taste and seeing both sides of the argument would be very beneficial.
0
Hello, All;

So. This is a Shopping cart, and what we are doing is calculating ALL items per row, and then we need to add them together.
(Sample with two products with multiple(s) of each product
keeping in mind, that the shopping cart, just like any other, can have ONE or 100's of items in it.)


item cost: $16.99 (Amount)
Total of items: 15 (ProductTotal)
= $254.85

item cost: $3.99 (Amount)
Total of items: 6 (ProductTotal)
= $23.94

The MemID is the only thing that will be consistant.
The Item_No however, will change for each product the customer adds.

select sum(Amount)*sum(ProductTotal) as SubTotal from Cart where MemID='z6GQ9UPF55JeSlWDRbib' and Item_No='HL-00000116' --  $254.85
select sum(Amount)*sum(ProductTotal) as SubTotal from Cart where MemID='z6GQ9UPF55JeSlWDRbib' and Item_No='HL-00000005' --  $23.94

Open in new window


OK, what I would LIKE to accomplish, is to have all the items that are in the shopping cart, added together, in one SQL Statement.
Instead of doing it in ASP Classic afterward.

Any suggestions on this would be great.
This it the last part of the Shopping Cart, and it is completed.

Thanks in Advance.
Carrzkiss
0
Hello, All;

In my Shopping cart, I need to have a PLUS and MINUS Button.
When the user clicks on the Plus (or) Minus button, I need it to update the total. Instead of having to click a Submit button.
(the total will feed in from another page, example: 1.asp, where it will make a database call, update the field, for the quantity the customer has chosen.)

I found this code. https://css-tricks.com/number-increment-buttons/
However, I am uncertain on how to make it work.
The author mentioned that using dynamically will work.

Any ideas would be wonderful.
Thanks
Carrzkiss
0
Hi all, just moving my site to SmarterASP hosting and having some issues with the database line....

This is error

Microsoft JET Database Engine error '80004005'
'E:\core\activcore.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.

oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("core/activcore.mdb")

Open in new window

'E:\core\activcore.mdb' - is the old serverpath, how do i convert it to the new one.

Cheers in advance
0
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
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
Cloud Class® Course: MCSA MCSE Windows Server 2012
LVL 12
Cloud Class® Course: MCSA MCSE Windows Server 2012

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

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

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.