We help IT Professionals succeed at work.

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.

I'm having trouble using double quotes in vbscript within asp web page.  I get various errors but I'm sure it's my syntax on the quote marks:

objCDO.AttachFile "ContactManagementActivityEditVCal.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "varVcal=yes&" & "var_SaleCall_ID=" &  rsSaleCallDataNewID.Fields.Item("ID").Value %>"
0
hi want to decode QRCode
from file
using asp.net ...
please help
0
Don get recaptcha

i have this form running good

  <form  method="post" action="contact.asp"> 
                       
                        <b>Envíenos un mensaje</b> <span></span>
                        <input  type="text" name="fname" id="fname" required placeholder="Nombre">
                       <input type="email"  name="email" id="email" required placeholder="Dirección de Email">
                      <input type="text" name="telefono" id="telefono" required placeholder="Teléfono">
                      <select name="Consultorio" type="text" id="consultorio">
                        <option>Elija Consultorio...</option>
                        <option>Querétaro</option>
                        <option>San Miguel</option>
                    </select>
                    <!--<textarea name="message" id="message" placeholder="Escriba aquí su mensaje..." rows="10" cols="30"> </textarea>-->
                    <textarea name="message" id="message" rows="4" cols="50" required placeholder="Escriba aquí su mensaje..."></textarea>
                    <input type="submit" name="send" id="send"  value="Enviar Mensaje">
                    </form>

Open in new window


then i need to insert this

  <button class="g-recaptcha"
                                data-sitekey="6Lccr3wUAAAAAsdssasacLfhRgG1N9q49kVmVYZpOeQ"
                                data-callback="YourOnSubmitFn" type="submit" name="send"  id="send"  value="Enviar Mensaje">
                           Enviar Mensaje
                        </button>

Open in new window


where to insert?
My form do not work if i put button tag, its working  whit   <input type="submit"

Please you experts!
1
Hello

Firstly, I am not particularly familiar with asp, so I dont really know how to ask the question to get the result I want, so please forgive me if what I write is not clear or obvious.

I am trying to update a classic ASP website (which the client will not allow me to change for anything else more secure...).  

I need to show a list of manufacturer logos from our database where the manufacturer makes a certain type of product, defined in the query string url.  There are tens of thousands of manufacturers in the db, some make multiple different type of products.  I only want to show one instance of each logo.

The db contains the columns "Manufacturer" and "Type"

The query string url example would be "abc.com/index.asp?pl=type" where type would be replaced with the type of product we want shown on the page, lawnmower, learjet, cellphone etc

I have a page which does a similar thing, in that it displays a single logo for all manufacturers it finds in the database:

<%@ Language=VBScript%>
<% Response.Expires = -1 %>
<%
	pro_type= lcase(request.querystring("pl"))
%>

<table width="100%">
	<tr>
		<td width="100%">
			<table width="100%" border="0">

				<%
                    Set adoCon = Server.CreateObject("ADODB.connection")' initialize connection
                    Set ors = Server.CreateObject("ADODB.RecordSet")' initialize record set
                    Const COLUMN_COUNT = 1
                    strSQL = "SELECT Distinct Manufacturer FROM 

Open in new window

1
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
Hi there, I have been trying to build an auto sum script, however all examples I have seen, either make no sense or I make a mess of it (dont know where to put)

Is anyone able to help me build one from scratch?

The Site:
http://dev.gptouring.com.au/home.asp?c=35&p=1&d=80

The autosum is of the products from each category, radio buttons with the autosum at the bottom of the page.

If you need some code, please let me know

Cheers in advance
0
Hi all, I am having some issues with expand/collapse and wondering if anyone can help

The issue I am having is it is auto expanded, where I want it collapsed

You can see here: http://dev.gptouring.com.au/home.asp?c=35&p=1&d=80

VBScript
function Expand(node)
	{
	if (node.children.length > 0)
		{
		if (node.children.item(0).tagName == "IMG")
			{
			node.children.item(0).src = "http://www.gptouring.com.au/images/GPT/s-collapse.png";
			}
		}
	node.nextSibling.style.display = '';
	}

function Collapse(node)
	{
	if (node.children.length > 0)
		{
		if (node.children.item(0).tagName == "IMG")
			{
			node.children.item(0).src = "http://www.gptouring.com.au/images/GPT/s-expand.png";
			}
		}
	node.nextSibling.style.display = 'none';
	}

function Toggle(node)
	{
	if (node.nextSibling.style.display == 'none')
		// Unfold the branch if it isn't visible
		{
		Expand(node);
		}
	else
		// Collapse the branch if it IS visible
		{
		Collapse(node);
		}
	}

Open in new window

Code:
<td height=15 colspan=4><a onClick='Toggle(this)' id='CorporateStaff' style='CURSOR: hand'><img src=http://www.gptouring.com.au/images/GPT/s-collapse.png height=15 valign=middle>&nbsp;<font size=2>Expand to upgrade your <%=PackageItemHeroType("itype_name")%></font></a>
<div>
<table width=100% cellpadding=0 cellspacing=0 border=0>
<tr>
<td height=40><%=ItemOptionDisplayName%></td>
<td height=40 width=72 align=center valign=center>
<table width=72 height=36 cellpadding=0 cellspacing=0 border=0>
<tr>
<td height=36 background=<%=BrandDir%>/item-<%=PackageItemOption("prod_items.item_ID")%>.jpg style='background-size:cover;background-position: center,center'><a href=images/GPT/image.jpg><img src=<%=BrandDir%>/s-i-outline-zoom.png width=72 height=36></a></td>
</tr>
</table>
</td>
<td height=40 width=50 align=center><input type=radio name=<%=PackageItemOption("pitem_ID")%> value=<%=PackageItemOption("pitem_gross")/PackageItemOption("pitem_pax")%>></td>
<td height=40 width=150></td>
</tr>
</table>

Open in new window

0
Hello All;

I have a table where the column is a varchar.
(If it needs to change to an INT or Date, please let me know and I will do so.
It is not too late to make that change.)
In the column named = Years
It has the following example.

1978
1965
1985
2017
1962
1998
2012
2002
1958
1978

OK, What I need to do is the following.
For the years in the table, they need to output as

1950
1960
1970
1980
1990
2000
2010
etc...

Thanks.
Wayne
0
Hello, All;

For SQL Server 2016.
I used to have this code lying around somewhere, but I am unable to find it.
OK.

table (SomeNames)
Johnny
Carr
Wayne
Ronda
Valerie
Tanya
Joey
Vin
Ron
Tony

OK, in the above, I would like to have a list of the Alphabets
Since there is NOT the whole list of letters to comprise the entire Alphabet, it would only show the letters for the names that are available.
For the example above, would be.


C
J
R
T
V
W

Once there are more names added which contain the other letters in the alphabet, then it will then display them letters.
And what I am going to do, is have each letter as a hyperlink on the page, to display all the names for that letter.

Hope this is clear.
I wish I knew where the code was at that I once have.
It is probably buried in a project script, of which I do not remember the name I gave it.
As it was about 5+ years ago, that I remember using it last, as it was at my old home.

Thanks all;
Wayne
0
Hi Experts,
On my classic ASP page I'm displaying a record like this:
<%=rs("UserID")%>

UserID always has to be 6 characters, e.g. 123456
When it's less than 6 characters I would like to display zeroes in front of it, e.g. when UserID is 23456 I would like to display it as 023456
Thank you for your help
0
Can someone help me identify what is wrong with my JQuery/Bootstrap?  On my main page (https://www.gopherstateevents.com/) the top dropdown works well...designed to work on mouse over.  This is a page created in Mobirise.  I tried to re-create the rest of my pages (using classic ASP) but the nav bar has to be clicked to function.  Here is an example:  https://www.gopherstateevents.com/results/cc_rslts/cc_rslts.asp?sport=cc

Obviously something is either mis-placed or missing altogether.  Any help would be much appreciated!
0
I need to be able to separate child nodes and apply logic

my XML Source: https://vpic.nhtsa.dot.gov/api/vehicles/decodevin/ZPBUA1ZLXKLA00941?format=xml

For some reason the text values are concatenating but I want them to be broken out by the Node name and value.  I put notes in the code.  The Code DOES work just not how I need it.

  
<%

url = "https://vpic.nhtsa.dot.gov/api/vehicles/decodevin/ZPBUA1ZLXKLA00941?format=xml"
     
     ' add a BASE HREF tag
     Dim xmldoc
     dim xmlhttp 
      
     Response.write "<BASE HREF='" & url & "'><P>" & url  & "<P>"
    
     
     set xmlhttp = CreateObject("Microsoft.XMLHTTP")
     Set xmlDoc = CreateObject("Microsoft.XMLDOM") 
     xmlhttp.open "GET", url, false 
     xmlhttp.send ""
          'response.write xmlhttp.responsetext
          
          xmlDoc.async = False
          bresult=xmlDoc.loadxml(xmlhttp.responsetext)
       
       State = ""
        ' WORKS ...Set NodeList = xmlDoc.getElementsByTagName("*")
        'Set NodeList = xmlDoc.documentElement.selectNodes("/Response/*")
        'Set NodeList = xmlDoc.documentElement.selectNodes("/Response/Results/*")
   Set NodeList = xmlDoc.documentElement.selectNodes("/Response/Results/DecodedVariable")
        'Set NodeList = xmlDoc.documentElement.selectNodes("/Response/Results/DecodedVariable/*")






        For Each Node in NodeList




         'I NEED SOME SORT OF LOGIC HERE
	           If Node.tagName = "VariableId" Then		        
		        ' 

Open in new window

0
I'm using VB.NET in ASP Web Forms.

I have a button click like this:

    Protected Sub Button1_Click(sender As Object, e As EventArgs)

        Dim DateTimeVar1 As DateTime
        DateTimeVar1 = "10/31/2018 01:05:00 PM"

        'Set Label With Variable Value
        Label1.Text = DateTimeVar1

    End Sub

How do I convert the DateTime variable DateTimeVar1 to a Date variable called DateTimeVar2 ?

So then the value stored in DateTimeVar2 should be: 10/31/2018
0
Hello, all.
(ASP Classic)

Splitting strings, in my case, I have multiple values coming from the database.

a = 94/95
b = value1/value2

Open in new window


Now, on the page, it will be.

<a href="?Type=Label&LabelID=<%=x%>" title="<%=y%>"><%=y%></a>

Open in new window


I can use a split, to get the values broken up.
However, since we are dealing with 2 different values coming in, I cannot use the split and it duplicates everything.

<%
a = split(LabelID,"/")
b = split(LName,"/")
for each x in a
for each y in b
'response.Write (x & "<br />")
%>
<a href="?Type=Label&LabelID=<%=x%>" title="<%=y%>"><%=y%></a>
<%
next
next
%>

Open in new window


So, my question is this.
How can I split it properly, to where it is only a single code that split both values?

Wayne
0
Dear all,

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

Example:

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

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

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

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

I just make a question ultimately!

Could someone help me to find a solution for this case

Thanks
1
Hi Experts,

I'm trying to connect to a Access DB in order to sanitize some data using PHP. I Have already enabled by PHP PDO ODBC driver  (uncomment the extension=php_pdo_odbc.dll line in php.ini) and restarted my IIS.

I get the following code...
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] SQLDriverConnect: 63 [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key Temporary (volatile) Ace DSN for process 0x14b8 Thread 0x11e4 DBC 0x22f8444 Jet'.' in C:\inetpub\wwwroot\DICE-AccessNOC\includes\access_db.php:18 Stack trace: #0 C:\inetpub\wwwroot\DICE-AccessNOC\includes\access_db.php(18): PDO->__construct('odbc:Driver={Mi...') #1 C:\inetpub\wwwroot\DICE-AccessNOC\find-distinct.php(6): Access_DB::getDB() #2 {main} thrown in C:\inetpub\wwwroot\DICE-AccessNOC\includes\access_db.php on line 18

Open in new window


My includes/access_db.php is
<?php

$TBL = "TBL_DICE_Factorial_Analysis";

class Access_DB{
 
    private static $db;
    
    private function __construct() { } //no new objects can be created
    
    public static function getDB() {    
    
        $access_path = "Z:\\Business\\CLIENTS\\DICE Assessment\\Received Files\\NOC_Database_Backup_2_PHPCopy.accdb";
         
        //One connection per browser session
        if (!isset($db)) {
            $dsn = "odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)}; Dbq=$access_path;";
            self::$db = new PDO($dsn);
        }
        return self::$db;
    }
    
    public function __destruct() {

        self::$db->close();
        
    }
}

function print_variable($var, $label = '', $raw = true){

    echo '<br>=========START=========<br>';
    echo '<b>' . $label . '</b>';

    if ($raw == true) echo '<pre>';

    print_r($var);

    if ($raw == true) echo '</pre>';
    echo '<br>=========END=========<br>';
}
?>

Open in new window


The caller is
<?php
    require_once 'includes/access_db.php';
    
    $query = "SELECT * FROM $TBL ORDER  BY NOC_Code, NOC_Occupation; ";

    $db = Access_DB::getDB();

    $statement = $db->prepare($query);
    $statement->execute();
    $rows = $statement->fetchAll(PDO::FETCH_ASSOC);
    $statement->closeCursor();

    print_variable($rows, 'Fact Analysis');
?>

Open in new window


I have also given full permissions to HKEY_LOCAL_MACHINE\SOFTWARE\ODBC and its children to IIS_IUSRS, but the issue persists.

I'm also posting this under ASP, as I see on Google, this also occurs under ASP.

Any help will be greatly appreciated.
0
How do I extract parent values and all child values from deserialized JSON, one record per child value, to a List<T>?

Sample JSON:  json_sample.txt

So from the attached sample JSON we wish to add the following records to the  list:
Record 1:  aen: Y456789, studentID: 1016, need: MMM, rank: 1
Record 2:  aen: Y456789, studentID: 1016, need: PPP, rank: 2

All records with "needs : null" to be ignored and all "need": "Not Specified" to be ignored. Sample code below:



      CTFNeedDataBatch =
                           (from people in myJSON.content
                            select new NeedCTF
                            {
                                studID = people.StudentBasic.studentId.ToString(),
                                AEN= people.StudentBasic.aen.ToString(),
                                Code = (people.StudentSensitive.needs == null ? people.StudentSensitive.needs[0].need.ToString() : ""),
                                Priority = (people.StudentSensitive.needs == null ? people.StudentSensitive.needs[0].rank.ToString() : ""),
                            }).Where(w => w.Code != "").ToList();


The problem with this code is we are not getting any values from the "needs" element and even if we were, I doubt we would be getting more than one record from an element that has more than one need.
0
Hi, Experts, I've got problem Inserting data on sqlserver 2008 using ASP or vbscript language. My problem here is when the amountA is has a comma then it would not save the Data. A message says; "There are fewer columns in the insert..." This maybe because of the comma in the amountA. What is the solution to handle the comma within the amountA? Any help please!

   ename = "John"
   amountA = "10,000.00"
   
   con.execute("Insert into zPhone(eName,AmountA) values('" & ename & "'," & amountA & ")")
0
We have an old database with around 400 stored procedures.
The stored procedures are called from an ASP Classic application.

Is there a way to know reliably which of the stored procedures are not being used by the application?
Or do we need to search for the stored procedure name on all the ASP pages in the application in order to find those that don't have any match?
0
Hi all, I am trying to get an autosum working adapting this code:
https://jsfiddle.net/SG7gu/289/

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

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

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

Open in new window

0
I am pulling my hair out on parsing a JSON API response (from ShipStation) due to the arrays within the response object.  I have always used a JSON parser (from demon.tw) which works perfectly for accessing the various items in a JSON object, however it does NOT work with arrays because of the fact that it is using JScript one cannot loop with a variable index.

I have tried a few other JSON classes but still had no success in being able to easily loop through each order and pull the relevant order information for each.

Below is a sample of the JSON response from the API. Can someone please help me loop through the orders (only 2 orders in the array in the sample below), and populate all the necessary order variables on each loop, such as OrderID, Customer info, billing/shipping addresses, line items ordered, priciing etc.


Open in new window

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 a job that I would like to get bids on...if that still happens on this site.  Here is what I need:

I need this page (https://www.gopherstateevents.com/results/fitness_events/results.asp?event_type=5&event_id=825&race_id=1427) to "scroll" vertically in marquee fashion for large screen display at races.  All I really need is the data table...or the data in the data table...to be visible.  Please let me know if you would be able to help me and what it would cost me.  I have tried to get this going in the "normal" process of doing it myself with EE help but, due to my weakness in JQuery, I just haven't gotten there.

Let me know if you have questions or if you can help me.
0
Hello, All;

Error
Active Server Pages error 'ASP 0126'
Include file not found
/cs/Header.asp, line 3
The include file '../Imported_Data/ACN.asp' was not found.

Code Line
<!--#include virtual="../Imported_Data/ACN.asp"-->

Open in new window


OK. I have been using this for years, and it still works on my Win2016 Server.
However, running it on my development system, of which is a Win10 Pro.
No longer works.
Enable Parent Paths
Is Enabled in IIS, for the Default Web Site, and all sub sites.

WHAT in the heck did Microsoft do, in the last update to break this?

The actual path of the files is stores in
wwwroot/Imported_Data/

I reference this location with all my sites.
And have NEVER had an issue, until the most recent Windows 10 update, and now it is broken.
At least on my Win10 system.
As stated, it all still works under my Win2016 servers.

Any idea on what can be done in order to get this back working again?
I would really hate to re-code all sites, just because of this one stupid issue.

Carrzkiss
0
Dear,
Any help to this problem?
31h.png
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.