ASP JSON: Object not a collection

In my experience it’s far easier to just use JScript as your server side scripting language than to use the aspjson class. You could render your JSON object as follows <%@language=”javascript”%> <!DOCTYPE html> <html> <body> <% var oJSON =[ { “PitcherID”: “456068” }, { “PitcherID”: “431148” } ] for (i in oJSON) { Response.write((oJSON[i].PitcherID) + … Read more

How do I enable upload of large files in classic ASP on IIS 7?

The maxAllowedContentLength controls how much data is allowed to be sent in a response. However you want to control how much can be accepted in a request. This is handled by the maxRequestEntityAllowed attribute of the limits element in the asp section of the config file. An example might look like:- <system.webServer> <asp> <cache diskTemplateCacheDirectory=”%SystemDrive%\inetpub\temp\ASP … Read more

Parameterized query in Classic Asp

In my code, this is how I get a recordset from a command: Set rs = server.createobject(“ADODB.Recordset”) Set cmd = server.createobject(“ADODB.Command”) cmd.ActiveConnection = Conn //connection object already created cmd.CommandText = “SELECT * FROM lbr_catmaster where catname = ?” cmd.CommandType = adCmdText cmd.CommandTimeout = 900 set prm = cmd.CreateParameter(“@prm”, 200, 1, 200, “development”) cmd.Parameters.Append prm ‘ … Read more

How to output an Excel *.xls file from classic ASP

It’s AddHeader, not AppendHeader. <%@ Language=VBScript %> <% Option Explicit Response.ContentType = “application/vnd.ms-excel” Response.AddHeader “Content-Disposition”, “attachment; filename=excelTest.xls” %> <table> <tr> <td>Test</td> </tr> </table> Update: I’ve written a blog post about how to generate Excel files in ASP Classic. It contains a rather useful piece of code to generate both xls and csv files.

How to upload files with asp-classic

long time since I’ve done that but we used an upload without third party components, just two vbscript classes (solution credit goes to Lewis Moten). It looks like you can still find this “Lewis Moten solution” in the wild If you include the clsUpload file, further upload process is as simple as: Dim objUpload Dim … Read more