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'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
Technology Partners: We Want Your Opinion!
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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
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
    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
    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
    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
    I have code that takes a nvarchar(max) value to run a SP.
    If I run the SP directly on SSMS it works fine, the SP does the job. But using ASP Classic code to pass the parameter which is a very long XML string to the SP is giving errors saying the data is getting truncated. Here is the code we currently have:

    set sp_usp_xmlparse = Server.CreateObject("ADODB.Command")
        sp_usp_xmlparse.ActiveConnection = MM_bluedot_STRING
        sp_usp_xmlparse.CommandText = "dbo.usp_XMLParse"
        sp_usp_xmlparse.CommandType = 4
        sp_usp_xmlparse.CommandTimeout = 0
        sp_usp_xmlparse.Prepared = true
        sp_usp_xmlparse.Parameters.Append sp_usp_xmlparse.CreateParameter("@RETURN_VALUE", 3, 4)
        sp_usp_xmlparse.Parameters.Append sp_usp_xmlparse.CreateParameter("@blob", 200, 1, -1, qnrBlobXML)
        sp_usp_xmlparse.Parameters.Append sp_usp_xmlparse.CreateParameter("@UserID", 3, 1, -1, UpdateStatus__MMColParam)
        sp_usp_xmlparse.Parameters.Append sp_usp_xmlparse.CreateParameter("@FirmID", 3, 1, -1, UpdateStatus__MMColParam2)
        sp_usp_xmlparse.Execute()
    

    Open in new window


    Any ideas what could be wrong?
    0
    [Webinar] Database Backup and Recovery
    LVL 11
    [Webinar] Database Backup and Recovery

    Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

    I want to use GetRows() in this query but I want to ensure that no meet included multiple times.  The goal is to speed the query up.  This "works" but is way slow and inefficient.  Thanks in advance!

        Set rs = Server.CreateObject("ADODB.Recordset")
        sql = "SELECT m.MeetsID, m.MeetName, m.MeetDate, m.MeetSite FROM Meets m INNER JOIN MeetTeams mt ON m.MeetsID = mt.MeetsID INNER JOIN Roster r ON "
        sql = sql & "mt.TeamsID = r.TeamsID INNER JOIN IndRslts ir ON ir.MeetsID = mt.MeetsID WHERE ir.RosterID IN (" & sSelectQS & ") AND ir.Place > 0 "
        sql = sql & "AND (m.MeetDate >= '" & dBegDate & "' AND m.MeetDate <= '" & dEndDate & "') AND Sport = '" & sSport & "' ORDER BY m.MeetSite DESC"
        rs.Open sql, conn2, 1, 2
        Do While Not rs.EOF
            If x = 0 Then
                AllMeets(0, x) = rs(0).Value
                AllMeets(1, x) = Replace(rs(1).Value, "''", "'") & " (" & Month(rs(2).Value) & "/" & Year(rs(2).Value) & ")"
                AllMeets(2, x) = rs(2).Value
                AllMeets(3, x) = Replace(rs(3).Value, "''", "'")
                x = x + 1
                ReDim Preserve AllMeets(3, x)
            Else
                For z = 0 To UBound(AllMeets, 2) - 1
                    If CLng(rs(0).Value) = CLng(AllMeets(0, z)) Then
                        Exit For
                    Else
                        If z = UBound(AllMeets, 2) - 1 Then
                            AllMeets(0, x) = rs(0).Value
                            AllMeets(1, x) = Replace(rs(1).Value, "''", "'") & " (" & Month(rs(2).Value)
    

    Open in new window

    0
    Hi Experts, just wondering if anyone has had any experience with SmarterASP webhost and sending emails from there?

    My old machine has died 2003SBS, and my Classic ASP website was setup for sending emails through that, currently it does not work through the SmarterASP host. just wondering if there is any work arounds or different config I would need to apply?
    0
    Dear all

    Well, it is a headache... What I do for reading accented characters in a textarea, for examples, of a webpage with source code sourece caracters and any metatag regarding the ". ISO".

    URL: http://www.filosofia.org/rev/bas/bas20101.htm


    del descubrimiento, en tanto &eacute;ste no puede hacerse consistir en un acto instant&aacute;neo de conocimiento, en una especie de revelaci&oacute;n s&uacute;bita. Cuando el explorador descubre una nueva senda en la selva, vali&eacute;ndose de su machete, las perspectivas que descubre conspectivamente implican a su vez resoluciones o disposiciones sobre el terreno recorrido. M&aacute;s a&uacute;n: como es imposible pr&aacute;cticamente en
    

    Open in new window


    Thank you in advance for any advice.

    Bob
    0
    I used to use the e-kov picturepreviewer.dll to extract image dimensions and details about uploaded image files. Even though I've registered the dll on my new Win 2016 server, it keeps throwing an error "object required". My question is; what other methods are there to get image height, width, size and other details in classic asp?
    0
    Dear Experts,

    I need a bit help for solving this issue.

    Theoretically the code is correct ( think), but is does not works properly.

    I have 2 files: 1 html file

    <form type="GET"  action="DROPDOWNDATABASEX.asp">
    <input type="text" name="look_for"  value="http://www.filosofia.org/rev/bas/bas10115.htm">
    <input type="submit"  value="Submit">
    </form>
    

    Open in new window


    and 1 .asp file:
    Dim strKeyword,look_for
    	 strKeyword = Request.QueryString("look_for")
    response.write strKeyword & "<br>" 
    
    
    rs.open "SELECT * FROM add0 where url like 'strKeyword'  ",con
    

    Open in new window


    The message I read after running:

    response.write strKeyword = http://www.filosofia.org/rev/bas/bas10115.htm

    So it understand what is "strkeyword", but when I use SELECT it does the following message:

    Sorry, no matching record was found.

    BUT IN DATABASE THE THERE IS A REGISTER = THIS URL  !!!

    If I use

    rs.open "SELECT * FROM add0 where url = 'strKeyword'  ",con
    

    Open in new window

    = Sorry, no matching record was found.

    However, evidently If I use

    rs.open "SELECT * FROM add0 where url = "'&strKeyword&'"  ",con
    

    Open in new window


    It gives all entries with urls of the database, but I need the exactly url I entered!!!


    Please, could someone help me?

    Thanks

    Bob K.
    0
    Hi there.

    I am moving a well functioning database (classic asp and MySQL) from one server to another (classic asp and SQL Server).
    I have trouble making it work. I changed the connection string as it should be, but when testing a login page that connects to SQL, then I get a time out and the usual 500 - internal server error.
    I use classic asp with SQL Server with no issues on another server setup. I used the same concept as there. Here's the connection string:

    "Driver={SQL Server};Server=servername;Database=databasename;Uid=username;Pwd=password;"
    

    Open in new window


    That setup never failed for me.

    On this particular server I question if the created user (the user in the connection string) on the SQL server has got enough rights. The admin only checked "public" for "Database role membership". On a server I control I had to check more options to make it work. Is "Public" enough?

    Can anyone help me with some trouble shooting?  
    Is there a simple code I can use to test the connection from an asp-page to the SQL Server?
    Thank you.

    Best regards

    Ulrich
    0
    I am looking for a plugin for an ASP Classic web application that uses Bootstrap/SQL

    We have some text fields or HTML editors where currently users have to type, I was wondering if there is any software out there that would allow a user to use their mic to enter the text into the HTML editor with speech.
    0
    Dear all Experts in ASP Classic

    I am working with asp classic and msaccess db

    I need a bit help for this script to be executed according my needs.

    <%
    set conn=server.CreateObject("adodb.connection")
    conn.open "Provider=Microsoft.jet.oledb.4.0;data source="& server.MapPath("db\bd1.mdb")
    set rs_main=server.CreateObject("adodb.recordset")
    
    rs_main.open "select fileid,title,texts from add0",conn,1,2
    
    do while not rs_main.eof
        d=rs_main("texts")
    	title=RS_MAIN("title")
    	dim p
        p=1
        for x=1 to len(d)
        if mid(d,x,1)="," or mid(d,x,1)="." or mid(d,x,1)="!" then
        texts=mid(d,p,x-p)
        p=x+1
        conn.execute("insert into table2 values ("&rs_main("fileid")&",'"&title&"','"&texts&"')")
        end if
    next
    rs_main.movenext
    loop
    rs_main.close
    set rs_main=nothing
    %>
    

    Open in new window



    Where:

    Table name = Add0
    fields
    fileid (autonumerical)
    title (text=100)
    texts (Memo)

    Table name = table2
    fileid (autonumerical with  duplicates)
    title (text = 100 with duplicates)
    texts (text = 100 with duplicates)


    GOAL:

    The script splits a long memo field into substrings splitted by "." or "," or "!", but not works adequately because sometimes a substring are larger than the width of the table2.texts

    Do you know a way to change this script to split (1) the substrings in 10 words or (2) length (=100) avoiding to cut words or (3) each capital letter?

    I would be grateful for any help..
    0
    This javascript function uses a variable (newPrice)

    I need to include it in the savedata.asp as a variable to be passed like &newPrice=(I dont know how to insert the js newPrice Variable) newPrice is already defined properly, it has a proper value

    $("img#otro").on("click",function(){
     if(send && Validate("form[name=forma]")){
      send=false;
      $("form[name=forma]").ajaxSubmit({url: 'savedata.asp?origen=Otro&newid=<%=Request.Cookies("newid")%>&evento=<%=Request.Cookies("evento")%>&referer=<%=referer%>', type: 'post', success: function(){
       $( document ).ready(function() {
    	DrawCaptcha();
    	totalPrice += newPrice;
        document.forma.reset();
        send=true;
        alert(totalPrice);
    

    Open in new window

    0
    Get expert help—faster!
    LVL 11
    Get expert help—faster!

    Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

    How can I make the hidden div with the gif visible on submit at http://www.gseannouncer.com/'

    Please note that the page submits to itself.  If I can't make the div visible onsubmit then I understand that I will have to use ajax/jquery.  The key is that I need it to happen as quickly as possible.

    Thank you so much!
    0
    I have a classic asp page that I want to display a "processing wheel" or similar gif while it is processing.  I would like it to start when the user clicks a button and stop when the submission has completed and the page is fully loaded.  Any help would be much appreciated.
    0
    |Dear all,

    I am working with MS Access.

    I have two tables:

    TABLE2 - with the field texts(char)

    and

    Table1 - spanish (text 30 chars)

    I want find on table2.texts each register placed on Table1.spanish

    Examples (that not works):

    rs.open "select * from table1, table2 where table1.spanish like '%" & table2.texts & "%' ", con

    rs.open "SELECT table1.*, table2.texts FROM table1 INNER JOIN table2   ON table2.texts LIKE ('%" &  table1.spanish & "%') ", con

    Example: table2.texts: "Y eso ha sido exactamente lo sucedido en los últimos 10 años con un sector bancario que en 2007 sobrevaloraba tanto su solidez
     "
    table1.spanish: "sector bancario"

    But these codes not works.

    Could someone please place a code that works?

    Thanks in advance
    0
    Would it be possible to transport a value from a classic ASP string to the user his or her clipboard using pure javascript only?

    I've found this example and tried to modify it to work with a hidden form input. But without succes.
    0
    Thanks for reviewing this.

    My server auto updated asp. Net framework and a bunch of other stuff KB4041681.

    As. Net 2.0.50727.0 and myself 6.1.3601.17514 throws out errors consistent with client query activity..

    Error [HY000] [MySQL] [ODBC 5.1 Driver] [mysqld-5.5.12] Deadlock found when trying to get lock; try restarting transaction

    The windows apication error log references the application server and there are no other direct error references, though there are a few windows system errors in the log but it seems best to start with the obvious one.

    As a direct or indirect result a legacy app using asp.net but coded over 5 years ago is running up errors in cost report totals other functions seem normal.

    The timing of the error is consistence with the windows update.

    Any advice or pointers greatly appreciated.. Specifically I'm wondering if it's possible to simply roll back that update, though there had been 3 minor ones since it doesn't necessary guarantee the libraries and other files will be restored to the same state prior to the error, so not sure if other problems might occur unless the specific files updated causing the error can be identified.

    Once again thanks for reading..
    0
    I'm uploading a file, using an asp FileUpload control but want to change the default text after a successful upload. When the control/page renders the default text is: "No file selected". It also defaults to this after the successful upload. I'd like to change it to something else if that's possible? Thanks.

    <asp:FileUpload ID="flupldIAAPhotos" runat="server" />
    

    Open in new window

    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.