Go Premium for a chance to win a PS4. Enter to Win

x

ASP

80K

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

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 as change this script to split the substrings in 10 words or length (=100) avoiding to cut words?

I would be grateful for any help..
0
Concerto's Cloud Advisory Services
LVL 5
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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
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
|Dear all,

I am working with ASP CLASSIC

I did not use querystring. Just table to table.

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

Expert Comment

by:Brian B
Hi Bob. You have entered this as a post, but it looks like it is a question. To get the best response from the Experts, you should probably re-submit this as a question using the "ask a question" button at the top of the page, or this link: https://www.experts-exchange.com/askQuestion.jsp

Please see here for further details: http://support.experts-exchange.com/customer/portal/articles/756544-how-to-succeed-at-ee-as-an-asker
1
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
I have a web site that uses an Excel 2007 spreadsheet to store information for displaying new pages when buttons are clicked.  It has been function for more than a year with the following connection information

mystring="Driver={Microsoft Excel Driver (*.xls)};"
mystring=mystring & "DriverId=790;Dbq="& Server.MapPath("2012_SimplifiedItemsForSale.xls")

This now fails with the following error message:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Excel Driver] Reserved error (-5016); there is no message for this error

Searching the web, I found that many people have seen this error, and the recommendation is to use a different OLEDB driver.

I downloaded and installed AccessDatabaseEngine from Microsoft site and changed the code to the following:

mystring="Provider=[Microsoft.ACE.OLEDB.16.0]"
mystring=mystring & Server.MapPath("2012_SimplifiedItemsForSale.xls")

The new error code is:

ADODB.Connection error '800a0e7a'
Provider cannot be found. It may not be properly installed

Q1.  Can anyone tell me if I have properly written the code to use the new OLEDB?
Q2.  Is there another step that must be taken to be able to use the driver software?

Office 2007 is installed in c:\Program Files (x86)

Help. Please.
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
Keep up with what's happening at Experts Exchange!
LVL 11
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.

For years we have been using the following vb code in a Classic ASP page to retrieve data from a software product.
To boost performance and get away from Classic ASP, I need to ASHX C# equivalent of the following  

    //set h = CreateObject("MSXML2.SERVERXMLHTTP")
    //h.open"POST", "http://localhost/isapi/webapi.dll"  //this is a software provided dll that accepts xml objects and returns xml response objects
    //h.setOption(2) = 4096
    //h.send(doc)
    //response.Write("<br><textarea rows=\"20\" cols=\"60\">" + h.responseText + "</textarea>");    
    //for each response in h.responseXml.selectnodes("//Response")
    //response.Write("<br><textarea rows=\"20\" cols=\"60\">" + response.xml + "</textarea>");
    //next
runner.txt
0
Hi, I' need to select a specific node in an xml doc... i have this which gives me everything

For Each xmlNode In objXML.documentElement.selectNodes("Data")

but i need a single node and its related nodes that has a specific value.. please see the xml

for example: I need to select only the Data where Bookcode = NEA-CSOP

Thank you

<DocumentElement>
<Data>
  <BookCode>NEA-CSOP</BookCode>
  <BPSday>3</BPSday>
  <BPSwk>6</BPSwk>
  <BPSmth>8</BPSmth>
  <Trackday>-44.6</Trackday>
  <TrackPnL>0</TrackPnL>
  <WAIVImv>0.239</WAIVImv>
  <WAIVexp>0.252</WAIVexp>
  <x90Day>0.256</x90Day>
</Data>

<Data>
<BookCode>NEA-EA1</BookCode>
<BPSday>18</BPSday>
<BPSwk>39</BPSwk>
<BPSmth>44</BPSmth>
<Trackday>-23.5</Trackday>
<TrackPnL>0</TrackPnL>
<WAIVImv>0.219</WAIVImv>
<WAIVexp>0.217</WAIVexp>
<x90Day>0.256</x90Day>
</Data>

<Data>
<BookCode>NEK-MV4</BookCode>
<BPSday></BPSday>
<BPSwk></BPSwk>
<BPSmth></BPSmth>
<Trackday></Trackday>
<TrackPnL></TrackPnL>
<WAIVImv></WAIVImv>
<WAIVexp></WAIVexp>
<x90Day></x90Day>
</Data>
<DocumentElement>

Open in new window

0
Hi Experts

I want to generate dates from to day to next year the same day, ie:
13/11/2017 18:57:29
14/11/2017 18:57:29
15/11/2017 18:57:29
16/11/2017 18:57:29
etc...

But I want to exclude Fridays and Saturdays

And I want to divide each day by 11 hours starting from 8 AM to 7PM,  and each hour divided by 15 minutes

Ie:
13/11/2017 08:00:00
13/11/2017 08:15:00
13/11/2017 08:30:00
13/11/2017 08:45:00
13/11/2017 09:00:00
13/11/2017 09:15:00
13/11/2017 09:30:00
etc... until
13/11/2017 : 19:00:00

And then display next day, and so on

Can anyone please help me with the code.
0
I have an ASP page that displays data pulled from an excel sheet with a named range called "tblData" in the cell of the table where I have a percentage number I want to make it to where if the number is between 1 and 5 then the cell is green. if the umber is between 6 and 8 its yellow, then if its over 8 its red. this is what I have now:

<%
If rs.Fields("2017 Rate") >= 1 OR rs.Fields("2017 Rate") <= 5 then
	Response.Write "<td bgcolor='green' style='width: 301px; height: 21px;' class='auto-style3'>"
Elseif rs.Fields("2017 Rate") >= 6 OR rs.Fields("2017 Rate") <= 8 then
	Response.Write "<td bgcolor='yellow' style'width: 301px; height: 21px;' class='auto-style3'>"
Elseif rs.Fields("2017 Rate") >= 8 then
    Response.Write "<td bgcolor='red' style'width: 301px; height: 21px;' class='auto-style3'>"
End If
%>
<strong>
<%=rs.fields("2017 Rate")%>
</strong></td>

Open in new window


and it just colors all the cells in that column green regardless of the number.
0
I would like to replace this calendar (http://www.gopherstateevents.com/calendar/calendar.asp) with one that is a little more contemporary.  I use classic asp/sql server.  I am using bootstrap. for layout.

Thanks!
0
i wanna knowing to run asp pages without IIS or PWS
0
Hi All

we've previously had this working (on sbs2011 server), but since sql server migration and moving of the asp site to a different server, it no longer seams to work...

 sPath="\\SERVER1\SHARED_Folder\" 
						
		sPath=sPath & jobnum 
		if fs.FolderExists(sPath & " " & jname) then
		 response.write("Folder already exists!")
		else
		sPath=sPath & " " & jname
		fs.CopyFolder "\\SERVER\SHARED_Folder\200\new project template", "\\SERVER1\SHARED_Folder\new project template"
		fs.MoveFolder "\\SERVER1\SHARED_Folder\new project template", sPath

Open in new window



however if i do the same code but pointing to a network share on the server where sql and asp site is located it all works fine... folder permissions are identical.

is there a reason for this.... any work around?
0
We ran a vulnerability scan and got this alert:  HTTP Security Header Not Detected
Description:  This QID reports the absence of the following HTTP headers according to CWE-693: Protection Mechanism Failure

How can we fix this issue?
We are running the application on IIS7
0
Hi,

Created a powershell script to create a local admin user but keep on getting
"Exception calling "SetInfo" with "0" argument(s): "The specified network password is not correct."


Please advise what is wrong.
J.


#Create local user and make it administrator
$LocalUser = 'NewLocalAdminUser'
$Computers =   @('servera','serverb')
$Date = "get-date"
$Description = 'Newly created user on $date by $env:username'
$GroupName = 'Administrators'
$Password = 'NewPassword!'
#$Password = Read-Host -AsSecureString
foreach ($computer in $computers)
{
  if ((Get-LocalGroupMember -Computername $computer -Name $GroupName) -contains $LocalUser) {
    Write-Host "$LocalUser already exists, setting new password" -ForegroundColor Green
    Set-LocalUser -Name $LocalUser -Password $(ConvertTo-SecureString -AsPlainText -Force -String $Password) -Computername $computer
  }
  else {
    Write-host "Setting $LocalUser on $computer"
    New-LocalUser -Name $LocalUser -Computername $computer -Password $(ConvertTo-SecureString -AsPlainText -Force -String $Password) -Description $Description
    Add-LocalGroupMember -Computername $computer -GroupName $GroupName -name $LocalUser
    if ((Get-LocalGroupMember -Computername $computer -Name $GroupName) -contains $LocalUser) {Write-Host "$LocalUser succesfully added to $computer" -ForegroundColor Green}
  }  
}
0
How to Use the Help Bell
LVL 11
How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

We had a field which was nvarchar 8000, it was changed to a text field to accomodate more characters.

I currently have the code below to call the Stored Procedure, but the parameter is for 8000 characters, how should I change it to allow the entry of as many characters as the text field allows?

<%

Set UpdateSignature = Server.CreateObject ("ADODB.Command")
UpdateSignature.ActiveConnection = MM_bluedot_STRING
UpdateSignature.CommandText = "UPDATE Userlogin SET Emailsignature = ? WHERE  userid = ?"
UpdateSignature.Parameters.Append UpdateSignature.CreateParameter("MMColParam", 200, 1, 8000, MM_IIF(Request.Form("signature"), Request.Form("signature"), UpdateSignature__MMColParam & ""))
UpdateSignature.Parameters.Append UpdateSignature.CreateParameter("MMColParam2", 3, 1, 4, MM_IIF(Session("Userid"), Session("Userid"), UpdateSignature__MMColParam2 & ""))
UpdateSignature.CommandType = 1
UpdateSignature.CommandTimeout = 0
UpdateSignature.Prepared = true
UpdateSignature.Execute()

%>

Open in new window


Something else that may be relevant is that this field is intended to save the user's signature block, if they add an image (their logo) then the HTML editor converts it into characters and this is where 8000 characters don't seem to be enough.
I am not sure if because we are including an image I may need to use a different type of data for the user, otherwise I guess text fiedl will work.
0
I have an ASP classic application that sends emails, I currently use an old extension for Dreaweaver to generate the code that sends emails. Its like a wizard, you fill out the necessary information and the extension creates the code.
Unfortunately the latest versions of Dreamweaver do not support this extension anymore.

I am looking for some sort of template/code/plugin I can use to replace the old code, something more modern I guess.

The current extension allows me to specify the following:

1.  SMTP server details (CDOSYS)
2. Subject
3. Recipients (to/cc/bcc, this can be a list that comes from a result of a recordset)
4. Attached documents (Also from the results of a recordset, could be more than one attachment)
5. HTML for the body of the email

Anything to replace this extension must include the above at least.

Any suggestions are greatly appreciated.
0
I have a news table with a related keywords table.

So on each news page I just want to be able to list the top 3 related news items ordered by the most matching keywords. I'm just not sure how to best query this?

So there are three tables:

News table

Keywords table

News :: Keywords table
0
Hi Experts,

I'm trying to automate a script that sends a daily email to registered users - my script is below - I want Task Scheduler to run the script, however in testing in CMD I get the following error -

Microsoft VBscript Runtime Error Variable is undefined : 'Server'

Here's my code -

Option Explicit

' FileName="Connection_odbc_conn_dsn.htm"
' Type="ADO" 
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_SITE_STRING
MM_SITE_STRING = "Provider= SQLOLEDB; Data Source=217.111.111.111,1433; Database=DBASE;uid=USER;pwd=XXXXX;"
' create recordset of email recipients - this runs a SP on the Server

Set cmdAlertRecipientList = Server.CreateObject ("ADODB.Command")
cmdAlertRecipientList.ActiveConnection = MM_SITE_STRING
cmdAlertRecipientList.CommandText = "dbo.SITEDailyJobsbyEmailRecipientList"
cmdAlertRecipientList.CommandType = 4
cmdAlertRecipientList.CommandTimeout = 0
cmdAlertRecipientList.Prepared = true
set AlertRecipientList = cmdAlertRecipientList.Execute
AlertRecipientList_numRows = 0

If not AlertRecipientList.eof then
arrAlertRecipientList = AlertRecipientList.GetRows()
End if 

AlertRecipientList.Close() 'Clean Up
Set AlertRecipientList = Nothing 'Clean Up
Set cmdAlertRecipientList = Nothing 'Clean Up

'Loop through recordset to get ID for each recipient 

If IsArray(arrAlertRecipientList) AND UBound(arrAlertRecipientList,2) >= 0 Then

'Now for each record a subroutine i.e for each record do something.
Dim 

Open in new window

0
I need to put a function on my emails where we can track the initial link that is being clicked.  The way I currently do this is to put a small php/asp script onto the website and add the script onto the hyperlink - something like this:

https://www.website.com/tracking.php?ID=123456789&PID=meetingaccepted

When the script runs, it takes the user to the relevant page (PID) and sends an email with the ID number to a designated email address (that can then be processed). This function is going to be used by several companies, so I need to minimise what I ask them to do when setting things up.  

Historically the companies that have used an early version of this function have been fine with adding a small php/asp script to their site and setting up a mailbox.

Ultimately, the marketing guys just need the ID, whereas the Tech guys need to be happy (security, ease of implementation etc.). So, is this a good way to do it - or is there a better method?  

Thanks.
0
Hi whats the best, quickest and easiest way to style positive (blue) and negative (red) numbers in an asp page. Code is below and I'm using a CSS include to style stuff... Thanks


table {
    border-collapse: collapse;
    width: 100%;
}

th{
	background-color: #87C5FF
		font-family:Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;
    text-align: left;
    padding: 9px;
	font-size:11px;
}
td {
	font-family:Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;
    text-align: left;
    padding: 9px;
}
tr:nth-child(odd){
	font-family:Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size:10px;
	background-color: #eef6ff
	}
tr:nth-child(even){
	font-family:Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size:10px;
	background-color: #ffffff
	}

Open in new window



<%
   Set objXML = Server.CreateObject("MSXML2.DOMDocument.3.0")
   objXML.async = False
	objXML.Load (Server.MapPath("book/NWP-MV.xml"))
	
	
'select each node in the data
	For Each xmlNode In objXML.documentElement.selectNodes("Data")

		'strTitle = xmlProduct.selectSingleNode("EnsembleID").text

     xIssue = xIssue & xmlNode.selectSingleNode("Issue").text & ","
	 xEnsembleID = xEnsembleID & xmlNode.selectSingleNode("EnsembleID").text & "," 
    ' xBookCode = xBookCode & xmlNode.selectSingleNode("BookCode").text  & ","        
     xStatistics = xStatistics & xmlNode.selectSingleNode("LongBLPTicker").text & ","
	 xStubPos = xStubPos & xmlNode.selectSingleNode("StubPos").text 

Open in new window

0

ASP

80K

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.