Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x

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

Hi Experts,
I have a hard coded dropdown on my page, but I would like to populate it from a database table instead.
This is my code, and the table name from where I would like to populate it is QueueEnvironment and the two column names are Name, and QueueEnvironmentId. How can I make the option value QueueEnvironmentId correspond to Name in the dropdown?

<select name="Name">
<%
Dim rsName
set rsName=Server.CreateObject("ADODB.recordset")
sql="SELECT distinct(Name) FROM QueueEnvironment order by Name"
Set rsName = AdoCon.Execute(sql)
%>
<option></option>
<%
Do While Not rsName.EOF
Response.Write "<option value=''>"& rsName("Name") &"</option>"
rsName.MoveNext
Loop
Response.Write "</select>"
%>
0
What does it mean to be "Always On"?
LVL 5
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Hi Experts,
I'm updating the records where the checkbox is selected. It is working fine when users select at least one checkbox. But when they don't select anything, I get this error message:
Microsoft OLE DB Provider for SQL Server error '80040e14'
Incorrect syntax near ')'.
How could I add validation to my JavaScript to avoid this error message and remind users to select at least one checkbox.
This is my code:

<html>
<head>
<title>Edit</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function checkLikeMe($) {
    var x = document.getElementsByName('ID');
    for (var y = 0; y < x.length; y++)
        x[y].checked = $;
}

// End -->
</script>
<script type="text/javascript">
<!--
function validate_form ( )
{
	valid = true;
        if ( document.contact_form.DestQueueId.selectedIndex == 0 )
        {
                alert ( "Please select environment." );
                valid = false;
        }
        return valid;
}
//-->
</script>
</head>
<body>

<form name="contact_form" method="post" action="Recall_send.asp" onSubmit="return validate_form ( );">
<table class="border" align="center" cellpadding="0" cellspacing="0" width="500">
<tr>
<th>OU</th>

<th><input type="checkbox" onClick="checkLikeMe(this.checked)"></th>

</tr>
<%
rs.AbsolutePage = intPage
For intRecord = 1 To rs.PageSize
%>
<tr>
<td><%=rs("OU")%></td>
<td><input type="checkbox" name="ID" value="<%=rs("ID") %>"></td>
</tr>
<%
	rs.MoveNext
If rs.EOF Then Exit For
Next
rs.Close
set rs = Nothing

Open in new window

0
We are using MS SQL 2012R2.  One of our tables has a field which is varchar(MAX), we are changing it to nvarchar(MAX) in order to allow non-latin characters to be entered.

We already tested and worked fine. My question is:  For all the entries we already have in that varchar field, will they be affected in ANY way if we change the field to nvarchar?
0
I have a ASP textbox, that I scan a value into.

I want the form to Postback on the scan, currently I have to tab out of the textbox for the onchange event to fire.

Tried the same with JavaScript with the same result.

Any know how to do this?

Andy
0
Hi Experts,
I'm submitting multiple records with one submission. The problem is that some of my records contain commas, therefore the code below does not insert them correctly in the database table. Can you please let me know how to modify it? I would really appreciate your help.

strDestQueueId = Request.Form("DestQueueId")

for index = 1 to Request.Form("csvValues").Count
   strCsvValues = Request.Form("csvValues")(index)

   arrayValues = Split(strCsvValues, ",")
   strDeviceName = arrayValues(0)
   strOU = arrayValues(1)
   strSubOU = arrayValues(2)
   strFlt = arrayValues(3)

   'create SQL string for inserting data into database
   strSQL = "INSERT INTO TestTable (DeviceName, OU, SubOU, Flt, DestQueueId) VALUES ('"& strDeviceName &"','"& strOU &"','"& strSubOU &"','"& strFlt &"','"& strDestQueueId &"')"

   'now add data with Execute() method
   Conn.Execute(strSql)
next

Open in new window

0
Hi Experts,
I would like to insert all fields from my Form page. Right now I can submit only DeviceName and DestQueueId.
I would also like to submit the OU and SubOU fields but I don't know how to do it.
Please take a look at my Form and Process.asp pages
I would appreciate your help.

<html>
<head>
<title></title>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function checkLikeMe($) {
    var x = document.getElementsByName('DeviceName');
    for (var y = 0; y < x.length; y++)
        x[y].checked = $;
}

// End -->
</script>
</head>
<body>
<form name="contact_form" method="post" action="Process.asp">
<table border="1">
<tr>
<th><input type="checkbox" onClick="checkLikeMe(this.checked)"></th>
<th>Device Name</th>
<th>OU</th>
<th>SubOU</th>
</tr>
<%
rs.AbsolutePage = intPage
For intRecord = 1 To rs.PageSize
%>
<tr>
<td><input type="checkbox" name="DeviceName" value="<%=rs("DeviceName") %>"></td>
<td><%=rs("DeviceName")%></td>
<td><%=rs("OU")%></td>
<td><%=rs("SubOU")%></td>
</tr>
<%
rs.MoveNext
If rs.EOF Then Exit For
Next
rs.Close
set rs = Nothing
AdoCon.Close
set AdoCon = nothing
%>
</table>
<br />
<select name="DestQueueId">
<option value="5">Dev</option>
<option value="4">Stage</option>
</select>
<input type="Submit" name="Submit" value="Submit" />
</form>

</body>
</html>

Open in new window

     
And this is the code of the Process.asp
<!-- #include virtual="/RouteMapper/Connections/APSConn.asp" -->
<%
for index = 1 to Request.Form("DeviceName").Count
   strDeviceName = Request.Form("DeviceName")(index)
   strDestQueueId = Request.Form("DestQueueId")

   'create SQL string for inserting data into database
   strSQL = "INSERT INTO TestTable (DeviceName, OU, SubOU, DestQueueId) VALUES ('"& strDeviceName &"','"& strOU &"','"& strSubOU &"','"& strDestQueueId &"')"

   'now add data with Execute() method
   AdoCon.Execute(strSql)
next

'close Connection object
AdoCon.Close
Set AdoCon = Nothing

'Redirect to the completed.asp page
Response.Redirect "Default.asp"
%>

Open in new window

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 Experts,
My query returns multiple records that I would like to submit to a different table with a single submission.
I'm using checkboxes for each record that I would like to insert into my new table.
My "Process.asp" can insert only one record at once. How can I modify it to submit all records at once. Please take a look at my code.
I would really appreciate your help.
<html>
<head>
<title></title>
<link rel="stylesheet" href="/RouteMapper/css/Styles.css" type="text/css" />

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function checkLikeMe($) {
    var x = document.getElementsByName('DeviceName');
    for (var y = 0; y < x.length; y++)
        x[y].checked = $;
}

// End -->
</script>

</head>
<body>

<form name="contact_form" method="post" action="Process.asp">
<table border="1">
<tr>
<th><input type="checkbox" onClick="checkLikeMe(this.checked)"></th>
<th>Device Name</th>
<th>OU</th>
<th>SubOU</th>
</tr>

<%
rs.AbsolutePage = intPage
For intRecord = 1 To rs.PageSize
%>
<tr>
<td><input type="checkbox" name="DeviceName" value="<%=rs("DeviceName") %>"></td>
<td><%=rs("DeviceName")%></td>
<td><%=rs("OU")%></td>
<td><%=rs("SubOU")%></td>
</tr>



<%
	rs.MoveNext
If rs.EOF Then Exit For

Next

rs.Close
set rs = Nothing
AdoCon.Close
set AdoCon = nothing
%>
</table>

<center>
<br />
<select name="Environment">
<option value="5">Dev</option>
<option value="4">Stage</option>
</select>

<input type="Submit" name="Submit" value="Submit" />
</center>
</form>
</center>

Open in new window

0
I have a webpage that pulls data from access. I want it to display 3 columns for Jan and 3 columns for feb. Once March 1st hits, I want  feb to replace Jan and march to appear on the webpage.....I have attached a word file that might might help picture it. I just don't know how to move the last month to the left of the page and add the new month on the right on the 1st day of the month...

Any help appreciated..
0
Please help,
I am currently using the below code
SET objXmlHttp = CreateObject ("Msxml2.ServerXMLHTTP.6.0")
I am getting the "Security error"
I also tried, WinHttp.WinHttpRequest.5.1, no change getting the same error.
0
Free Tool: IP Lookup
LVL 11
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

Hi there.

I have some views on my  SQL server that I show on my web application in a simple table, and I have the feature to click an Excel icon to open the output in Excel.
I do also have some dynamic queries/Stored Procedures where I don't know the number of columns. In the views above I know the columns and wrote a code like this:

<%@ Language=VBScript %>
<!--#include virtual="/includes/conxxxxxxasp" -->
<% 
dim Conn,RS1
Set Conn = Server.CreateObject("ADODB.Connection")
Set RS1 = Server.CreateObject("ADODB.RecordSet")
strConn = MM_conmcd_STRING
Conn.Open strConn 
sql1 = "SELECT var1, var2, var3, var4, var5, var6 FROM tbl_xxxxx ORDER BY var1 ASC"
RS1.Open sql1, Conn 
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "attachment; filename=xxxx_export.xls" 
%>
<table border="1" width="100%">
<tr>
<td bgcolor="#000080"><font color="#FFFFFF">var1</font></td>
<td bgcolor="#000080"><font color="#FFFFFF">var2</font></td>
<td bgcolor="#000080"><font color="#FFFFFF">var3</font></td>
<td bgcolor="#000080"><font color="#FFFFFF">var4</font></td>
<td bgcolor="#000080"><font color="#FFFFFF">var5</font></td>
<td bgcolor="#000080"><font color="#FFFFFF">var6</font></td>
</tr>
<%Do While Not RS1.eof%>
<tr>
<td><%=RS1("var1")%></td>
<td><%=RS1("var2")%></td>
<td><%=RS1("var3")%></td>
<td><%=RS1("var4")%></td>
<td><%=RS1("var5")%></td>
<td><%=RS1("var6")%></td>
</tr>
<%
RS1.Movenext
Loop
%>
</table>
<%
RS1.Close
Conn.Close
Set Conn = 

Open in new window

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
Hi there, I have been considering converting my Access DB to MS SQL for a while now (security and speed are the main reasons), however I have no idea where to start!

I have a host (SmarterASP.NET) which supports MS SQL, however do not know how to 1 convert from Access to MS SQL and then upload that Data

Anyone able to help me?

Thanks in advance
0
Hi there, I have not had this issue up until about 1 month ago

my IIS is freezing due to the access databases opening its .ldb file (i can confirm that it is not being opened locally nor over the network)

to fix this I need to restart the Web Service on SBS2003, but shortly after it will freeze again.

Any ideas of what it could be? perhaps some code that is running wild?
0
    Hi,

    I installed Windows 2012 R2 on a server to run a single ASP site.  Copied the content from a working copy running on a developer's machine and got the following error when I tried to access it in IE locally(I defined the url in the hosts file):


    HTTP Error 500.19 - Internal Server Error

    The requested page cannot be accessed because the related configuration data for the page is invalid.



    Detailed Error Information:



    Module
       IIS Web Core

    Notification
       BeginRequest

    Handler
       Not yet determined

    Error Code
       0x80070021

    Config Error
       This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".  

    Config File
       \\?\d:\sites\timberww\htdocs\web.config



    Requested URL
       http://timberww.webworldinc.com:80/

    Physical Path
       d:\sites\timberww\htdocs

    Logon Method
       Not yet determined

    Logon User
       Not yet determined




    Config Source:
      143:     </modules>
      144:     <handlers>
      145:       <remove name="WebServiceHandlerFactory-Integrated"/>

    Line 144 is actually highlighted in red.

    The full handlers block consists of:
        <handlers>
          <remove name="WebServiceHandlerFactory-Integrated"/>
          <remove name="ScriptHandlerFactory" />
          <remove …
    0
    Hi there, I need some help creating cookies for new web visitors and recalling them when they come back

    Currently I have some code, however there is some issues, as only 1 computer will work, the rest have errors

    RemoteIP=Request.ServerVariables("REMOTE_ADDR")
    Set SessionLookup=oConn.Execute("SELECT * FROM site_sessions WHERE brand_ID='GPT' AND session_ID="&Session.SessionID)
    If NOT SessionLookup.EOF Then
    	Session_ID=SessionLookup("session_ID")
    	Cookie_ID=SessionLookup("cookie_ID")
    Else
    	If Request.Cookies("cookie")=NULL Then
    		Response.Cookies("cookie")=Session.SessionID
    		Response.Cookies("cookie").Expires=#Dec 31,2030#
    	End If
    	Session_ID=Session.SessionID
    	Cookie_ID=Request.Cookies("cookie")
    	oConn.Execute("INSERT INTO site_sessions(session_ID,cookie_ID,brand_ID,session_IP,session_date,session_refer) VALUES("&Session_ID&","&Cookie_ID&",'GPT','"&RemoteIP&"','"&Now()&"','"&Request.ServerVariables("HTTP_REFERER")&"')")
    End If
    

    Open in new window


    Microsoft JET Database Engine error '80040e14'
    
    Syntax error in INSERT INTO statement
    
    oConn.Execute("INSERT INTO site_sessions(session_ID,cookie_ID,brand_ID,session_IP,session_date,session_refer) VALUES("&Session_ID&","&Cookie_ID&",'GPT','"&RemoteIP&"','"&Now()&"','"&Request.ServerVariables("HTTP_REFERER")&"')")
    

    Open in new window

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

    We would like to know if it is possible to modify our website which has been developed in ASP so that it becomes responsive, but especially by keeping the headers and footers in a fixed position.

    Here is the original version of our website (not responsive) : http://www.ex0-sys.ch/

    We have a test version of our site that is responsive, but we do not master the technique to maintain our original design.

    Here the test version being modified (responsive) : http://94.103.101.201/Ex0.Web.Staging/

    What technologies should we use because it seems to be a major problem for everyone?

    Thank you in advance for your answers.

    Regards,

    RL
    0
    Hi there.

    I have  this stored procedure as you can see here:

    Save-query-generated-from-stored-procedure-to-table

    It has got a build in parameter Y/N whether it shall create/flush a table or not. How do I run the SP via VB code? And can I kinda build in the Y or N when launching it via VB?

    Best regards

    Ulrich
    0
    Free Tool: SSL Checker
    LVL 11
    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.

    Hi
    When HTTP Header Content-Security-Policy is set to "Default-src 'self', ASP text box does not get hidden

    Content-Security-Policy to Default-src 'self' on IIS
    This is the piece of code which used to be "hidden" from user, but by setting Content-Security-Policy to Default-src 'self', it shows up on the UI on FireFox and Chrome. It hides correctly on IE.  

                <div style="position: relative; float: left;">
                    <asp:TextBox ID="txtTop" runat="server" Width="0px" Height="0px" Style="background: #517ca6;
                        background-color: #517ca6; color: #517ca6;" BorderStyle="None"></asp:TextBox>
                </div>

    Any suggestion on how we can keep the control hidden, and be able to set Content-Security-Policy to Default-src 'self'?
    0
    asp.net Placing an image on an image control Does it have to be a URL

    The following is working fine
    Image1.ImageUrl = "~/data/" & ImageFileName  & ".gif"

    The following is NOT working
    Image1.ImageUrl = "C:\MySite\data\" & ImageFileName  & ".gif"

    Is there a way to make asp image control takes a normal path e.g. (d:\temp\mypicture.gif)
    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
    Need help getting this JavaScript to format with different date options like mm/dd/yyyy , mm/dd/yyyy 00:00 etc.

    <%@ language="VBScript" %>
    <!DOCTYPE html>
    <html>
            <head>
            <script language='Javascript' runat='server'>

                function jsGetPastTimeCurrent(minutes) {
                    var d = new Date();
                    var past = new Date();
                    past.setTime(d.getTime() + (minutes*60000));
                    var utcString = past.toUTCString();
                    var tz = utcString.indexOf("UTC");
                    if (tz > 0) {
                        utcString = utcString.substring(0, tz) + "CT";
                    }
                    return utcString;
                }
            </script>
    <% newDate=jsGetPastTimeCurrent(-360)%>
            <title>Timestamp</title>
        </head>
        <body>
        <p>
        <h2><%= newDate %> </h2>
        </p>
        </body>
    </html>
    0
    Hi there.

    I work on this web database with SQL Server back-end and classic asp/VB/Java script front-end. It's all on a dedicated Windows server I control almost a 100%. So far I used a login procedure where - at login - the page call a table in the database with user credentials and return a "Go" or "No" to proceed to other pages for logged in users only. A cookie is created at "Go" and will expire after an hour of inactivity. When expired, the user is returned to the login page.

    Now... I have to implement a procedure:
    Every 3 month a users password must be changed and live up to certain criteria like upper/lower case, number, special character etc.

    Option 1: I can try to program something in VB?? (I need help or some good suggestions)

    Option 2: I can skip the present concept and create all users on the server. To access the server a SMS pass code is required on top of the login credentials. But how can I implement the Windows Server authentication to the asp/VB coding?

    I would be very happy for some support here. It's a little new territory for me.

    And I'm sure it could work better with VB.NET, but that gotta wait some months. First I must make it work in classic asp/VB.

    I look forward to some wise words. :-)

    Best regards

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