asp-classic

If Not IsNull in ASP Classic

眉间皱痕 提交于 2019-12-12 17:13:05
问题 I'm fairly new to asp and I've got a syntax error I would like help on if you can. I've got an ASP page that shows a table that pulls data from sql. Most of the data hasn't been populated yet so returns a NULL. The data type in question is numeric. I need to FormatNumber the rs when it is not null and not populate if it is. This is what I have <%=If Not IsNull(rs("ContractValue")) Then FormatNumber(rs("ContractValue"),0) end if%> But as mentioned, im getting a syntax error. What am i doing

Using CLASSIC ASP to return data to jsonp call

懵懂的女人 提交于 2019-12-12 15:48:41
问题 I have been through the posts on stackoverflow and cannot seems to find what I am looking for. If I do (Form: $.ajaxSettings.dataType = "jsonp"; $.get('http://MYREMOTESERVER.com/GetCustNewID.asp?callback=?', function() { //SOMETHING HERE }); On The remote CLASSIC ASP server how, using asp, would I return the id? This Response.Write "[{""id"": " & Rs("@ID") & "}]" obviously does not work. Thanks for your help. 回答1: Here is the correct way to return jsonp using classic asp. We are not returning

ASP Readline non-standard Line Endings

不问归期 提交于 2019-12-12 15:17:51
问题 I'm using the ASP Classic ReadLine() function of the File System Object. All has been working great until someone made their import file on a Mac in TextEdit. The line endings aren't the same, and ReadLine() reads in the entire file, not just 1 line at a time. Is there a standard way of handling this? Some sort of page directive, or setting on the File System Object? I guess that I could read in the entire file, and split on vbLF , then for each item, replace vbCR with "", then process the

I'm getting blank pages instead of error messages using classic ASP, IIS6 and WinServer 2003 R2

心不动则不痛 提交于 2019-12-12 13:10:12
问题 We have an old system running on a WinServer2003 R2 - IIS6 and it was written using classic ASP. We need to trap all errors and for that, I configured IIS to redirect 404s and 500s to a custom page (custom errors config) that writes the info to a log file (this page creates and manages the logs). Here is the weird thing: The first time the error occurs, the page is redirected and I get my log file entry. But, if this page is loaded again (I hit F5, or other user goes there, etc), the browser

ASP array to JavaScript array

↘锁芯ラ 提交于 2019-12-12 12:52:29
问题 Here's my problem: I have a one-dimensional array that is a result of some server side code in the same .asp. I want to take this array and transfer the strings in it to a javascript array, so I can use the values in a table for displaying purposes. This is the code I have tried: <script language="javascript"> var jsArray = []; var n = <%=r%>; for (n = 0; n < 4; n++){ jsArray[n] = '<%=tulemused(n)%>'; //this isn't working for some reason } </script> I personally think the error is created by

How do I convert UTF-8 data from Classic asp Form post to UCS-2 for inserting into SQL Server 2008 r2?

試著忘記壹切 提交于 2019-12-12 12:24:47
问题 I am in the process of "modernizing" a classic asp application that uses a Access 2000 database. I rewrote the database on SQL Server 2008r2 and changed all of the fields to use the newer unicode enabled nchar, nvarchar, ntext and imported the old data. I also switched to IIS 7 from IIS 6 The classic asp is collecting and writing data using UTF-8. Now the application shows the OLD data correctly in the web pages but as son as I touch it ie: UPDATE or INSERT the data is getting corrupted. I

Find out how many thousands and hundreds and tens are there in a amount

隐身守侯 提交于 2019-12-12 12:07:37
问题 I am having a asp application and in that amount column is there. I need to find out how many thousands and hundreds and tens are there in that amount For example if i am having amount as 3660 means 1000's - 3 100's - 6 10's - 6 like this i need Can any body help me 回答1: The simple answer is to divide the number by 1000 whatever is the quotient that is the number of 1000's in the amount. Then divide the remainder with the 100's the quotient will be the number of 100's. And then again divide

How to debug ASP permission problems with WScript.Shell object?

僤鯓⒐⒋嵵緔 提交于 2019-12-12 10:54:14
问题 I have to run command line operation from some legacy ASP application. Here is my code: <% cmd = "%comspec% /c echo Hello" set wsh = CreateObject("WScript.Shell") ireturn = wsh.Run(cmd, 0, true) set wsh = nothing %> And here is result I am receiving: Microsoft VBScript runtime error '800a0046' Permission denied /test.asp, line 6 Do you have any idea how to make IIS6 to run this code? Note: Of course I don't have to run echo command but I want to exclude any additional causes of the problem.

How to hash a UTF-8 string in Classic ASP

一个人想着一个人 提交于 2019-12-12 10:08:25
问题 I've been looking for a Classic ASP script that allows me to hash a string using the MD5 algorithm. I need to match this hashed string against the same string in an ASP.NET Page, hashed using .NET's MD5 hashing algorithms. Even though I have found several scripts for Classic ASP that generate the hash, I haven't found one that generates the correct hash using non-English characters (like ñ , for example). Do you know some Classic ASP script that works in this particular case? Note: I have

return Array from C# to Classic ASP with COM

心不动则不痛 提交于 2019-12-12 09:43:37
问题 I am trying to return an array from c# to classic asp using com. This post helped me lot, but I still have problems: I have the following method in c#: public object[] returnStuff () { return new object[] {'1','2','3'}; } My classic ASP: dim responseArray1 responseArray1 = RegusSoapComponent.returnStuff() response.write("Type of Array one is " & VarType(responseArray1)) response.write("Type of Array one is " & responseArray1(1)) My output is: response is Type of Array one is 8204 Microsoft