asp-classic

IIS Web pool hang

Hi, I have an application pool set for hang monitoring every 30 seconds, I got this error returned from classic asp. After which no new asp requests were being served according to web logs. I wonder why it took IIS a full 5 minutes to shut the process down, and start a new process for the application pool? Error: File /unabletoproc...

How do I fire an asynchronous call in asp classic and ignore the response?

Here's the gist: I have a call I want to make in asp, and I do not care about the response. I just want to fire the call and I do not want the page to wait for the response. According to the documentation, it should look something like this: dim xmlhttp : set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP") xmlhttp.Open "POST", ur...

Problems with Recordset Filter

I'm having trouble with a filter on an ADO Recordset in legacy ASP Classic code, and I'm trying to understand if what I'm trying to do is not supported, or if I'm just doing it wrong. I have a recordset of Items, and they have a Status of 1 (active) or 0 (inactive), and an optional End_Date. In my administrative user interface, I have ...

How to set the base time for DateTime in IIS (ASP) for compatibility mode?

We have updated our servers with Windows 2008 Server, but we are still using SQL Server 2005 in our production software. The problem comes in one part of the system where we store times as datetimes. Since ever, storing a time in a datetime column stored the base date as the date. It is 1900-01-01 in SQL Server 2005. Back then, IIS under...

ASP classic db question

I am trying to execute a query like "show tables". But I don't know the column names that will be returned by the query. I've tried using something like RS.Fields(1).Name to show me the names but that doesn't seem to work. Any suggestions? Here is the full code: Response.Buffer = true Dim oConn, oRs Dim qry, connectst...

Using Access DB (.mdb) with ADODB in C# (ASP.MVC) like with Classic ASP

Hi, I used to work a lot with classic asp. I'm currently trying the ASP.NET MVC and like it so far, but I'm missing the simple usage of the ADODB Connection. I was searching the web, for any simple and clear solution like the code below, used on classic ASP, but everything I found was way more complicated and/or not with ADODB on C#. I ...

Cannot instanciate .Net COM object in classic ASP/VBScript page (Error ASP 0177)

I've written a COM interop enabled class-library in C# using .Net 3.5. The object is meant to provide some utility functions for classic ASP pages. I've written a test.asp page which instanciates the desired object and calls its methods. Works fine on my machine. On a different machine (Windows Server 2003 - Standard Edition) it doesn't...

ASP Classic GET request without multithreading

We are talking about Classic ASP and NOT ASP.NET! Lets start from top. We are using ISAPI_Rewrite and we would like to dynamically offer our customers to control rewriting of urls (giving them httpd.ini is not an option). We were thinking that all unknown url requests (we define this in httpd.ini) are controlled by one asp file which cr...

converting Legacy ASP app to ASP.NET: best approach

I've taken over support of a legacy web app written predominantly in classic ASP. One page has a form for doing a job estimate, and consists of about 2500 lines of javascript and ASP code to achieve a "transparent edit" - i.e., the form is always in edit mode, and changes are instantly updated into the DOM. There is also a "Print To Wo...

Export XML to Excel spreadsheet using Javascript/classic-ASP

I'm trying to export XML data from a web page to a spreadsheet using javascript. So far I've just tried the very simple: Sub Export Response.ContentType = "application/vnd.ms-excel" <script> var XML = document.getElementById("xmldata"); window.open(XML); </script> End Sub This t...

Classic ASP SQL Injection

I recently inherited a classic asp website with a ton of inline SQL insert statements that are vulnerable to SQL injection attacks. These insert statements are executed via the ADO command object. Will setting the ADO Command Object's Prepared property to true ensure that the query is parameterized before execution, thus mitigating the...

Sending email with recordset data

Hi there, I've got a classic ASP page listing some properties from a database and with each property there is a small contact form - to enable a user to 'request a callback' from the property agent associated with that property. However, whichever form I complete - the email to the agent always includes details of the first property on ...

ASP Classic and SQL Server 2008 giving strange response

Hi guys. Started getting this error it seems since we upgraded to SQL Server 2008. When inserting into the db and then returning the identity i get a 'Item cannot be found in the collection corresponding to the requested name or ordinal' error. Here is the code: SQL = "INSERT INTO PageFeatures(nPageFeatureFlagId,nPageFeatureFeatureId...

ASP display day of week

how to display day of week with VB ...

how to display current time with chosen timezone?

how to display current time with chosen timezone instead of server TZ? (VB) ...

Cannot use parentheses when calling a Sub

Hi there, I have a Classic ASP page that contains the following code to attempt a parametised query; <% Set cmdEmail = Server.CreateObject("ADODB.Command") Set rsEmail = Server.CreateObject("ADODB.Recordset") cmdEmail.CommandText = "SELECT * FROM VWTenantPropertiesResults WHERE ContentID = ?" cmdEmail.CommandType = 1 cmdEmail.ActiveCon...

ASP How do I insert a username into a table?

Hi all, I'm struggling with my code below, I'm reading the logged on users username and trying to insert their name into a SQL table called licenses, the table contains 2 columns 1 contains license numbers the other is all nulls at the moment but a username should be inserted along side one when this page loads. Currently the page just ...

Classic ASP to ASP.Net one-off session data copy

We have an extensive classic ASP site, and we're looking to upgrade to ASP .Net (most probably the latest version). Obviously upgrading all the pages at once would be a leviathan task, so we're only looking to write new pages (and page rewrites) in ASP .Net at first. There are two obstacles to doing so: I have no idea how to access cl...

Logout function for asp-classic site

Is there any way to provide a logout function for a site which uses classic asp, and which uses Windows authentication (i.e. the restricted folders have their permissions set via the server OS, and usernames/passwords are stored in Active Directory)? If it makes any difference, the server is running IIS 5.0. The logout needs to work for...

Creating Excerpt text with a read more link

I have a varchar field full of text and I want to be able to just show a 100 character snippet of the text, and show a "Read More..." link at the end of the snippet. When the user clicks "Read More..." I would like the page to expand and display the rest of the text. I guess the 'show/hide' featured could be done with jQuery but i wasn'...