asp-classic

Classic ASP (VBScript) replace special character in a string is acting strange

◇◆丶佛笑我妖孽 提交于 2019-12-13 13:29:05
问题 In classic ASP (VBScript), when I replace the string, a strange character appears. <% myString = "My Ttitle ®" myString = Replace(myString,"®", "®") Response.Write(myString) %> If I print this out to HTML, the final result is (Which has a strange A in it): My Ttitle ® 回答1: add this at the top of your page <%@ language="vbscript" codepage="65001"%> open your file in a text editor, (notepad will do) select Save As from the file menu and choose utf-8 rather than ANSI encoding add in your head

Classic ASP App CINT failure - twitpocalypse v2

浪尽此生 提交于 2019-12-13 13:05:06
问题 Due to a qty value exceeding what a VBScript INT can store, I'm getting a pretty nasty error message (actually the users are)... This is totally a case of twitpocalypse. Since CINT() will not work in this situation, what is the best workaround? requestqty = 40200 CInt() max = 32767 CInt(requestqty) EDIT CLng() seems to do the trick, any risk to the code to change all CInt() to CLng(). From what I've read below and elsehwere on the web, it seems like there is really very little reason to even

Calling ASP.NET web service from ASP using SOAPClient

我与影子孤独终老i 提交于 2019-12-13 12:30:51
问题 I have an ASP.NET webservice with along the lines of: [WebService(Namespace = "http://internalservice.net/messageprocessing")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ToolboxItem(false)] public class ProvisioningService : WebService { [WebMethod] public XmlDocument ProcessMessage(XmlDocument message) { // ... do stuff } } I am calling the web service from ASP using something like: provWSDL = "http://servername:12011/MessageProcessor.asmx?wsdl" Set service = CreateObject

Parameterized queries WITHOUT stored procedures?

最后都变了- 提交于 2019-12-13 12:08:32
问题 Every sample I've seen uses stored procedures. I've adopted an old application written in Classic ASP that uses inline SQL. This is an obvious issue, so I need to convert it to safer code. The client does not wish that I use stored procedures in this application, so is there a way to run parameterized queries without stored procedures? Thanks 回答1: Yes, there is. Have a look at some of these examples: http://www.securestate.blogspot.com/2008/09/classic-asp-sql-injection-prevention_30.html http

Why didn't work my classic asp source code?

为君一笑 提交于 2019-12-13 09:52:02
问题 When i run this code, nothing displayed, it shows blank. I checked inspector and network tab.. function storevaluestoSession() { var somewhere=map.getCenter() map.setCenter(somewhere); var somewhere=String(somewhere) var nloc=somewhere.search(','); var location2=String(somewhere).substring(1,nloc); var sw2=String(somewhere); var lsw2=sw2.length-1; var lsw22=nloc+1; var location3=sw2.substring(lsw2,lsw22); var myLatLng = new google.maps.LatLng(location2,location3); var lat2=ltrim(location2

Web services & Classic Asp

烂漫一生 提交于 2019-12-13 09:49:15
问题 I have a task at work ,using web services , to make communication between a web site based on Classic Asp & an application based on android platform , to create function with a parameter Date which provide data from the bd,i dont have any idea how to proceede , can u plz give me an example or tutos to follow ? 回答1: Your easiest option is to produce json (which can easily be consumed by the android side) like this: ASP "service" <!-- this is one example of a library of json helpers that you

Make a connection to Sql Server using Classic ASP

倾然丶 夕夏残阳落幕 提交于 2019-12-13 09:15:41
问题 I have created a form with an action attribute. I am able to take the values from the web form and display them (response.write...used for clarification that my values are being read) using my action_page. I have also created a database and a table on MS Studio Management. The step i'm stuck on is the code that is required in order to connect the web form values and the database. Thanks. Note: This is the action page, I did not include the form. Note: I am using notepad ++ and NOT visual

Change response to only respond one set of values

◇◆丶佛笑我妖孽 提交于 2019-12-13 08:55:16
问题 I am very novice at asp. Here is my code: response.write("<script>") dim counter: counter = 0 do until rs.EOF for each x in rs.Fields counter = counter + 1 response.write "var CC" & counter & "=" & x.value & ";" next rs.MoveNext loop response.write("</script>") This currently returns both columns from my DB: <script>var CC1=ALFKI;var CC2=13579;var CC3=ALFKI;var CC4=246;</script> I only want the second column to return, which is the numbers (13579 & 246). What should I change? 回答1: Not sure I

How to write multi line comments in classic asp?

前提是你 提交于 2019-12-13 08:39:24
问题 How to comment multiple lines of code in classic asp at once?I have tried using ' for every line that I want to comment.But, that is not the best way to do I believe.Can someone help me on this? 回答1: Use this: <!-- METADATA comment --> 来源: https://stackoverflow.com/questions/33143094/how-to-write-multi-line-comments-in-classic-asp

ASP Classic - Get last weeks date by day number

瘦欲@ 提交于 2019-12-13 08:37:09
问题 For example: What was the Date ( format: MM/DD/YYYY ) for 1? and the answer would be: 6/30/2014 Day number works like this: Monday=1 ... Friday=5 Sunday=7 So something like this: <% dim GetPastDay GetPastDay=1 '^ ^ ^ THIS WOULD MEAN THAT WE ARE LOOKING TO GET PAST/LAST MONDAYS DATE ' AND IF WE WHERE TO REPLACE THE 1 WITH A 5 THEN IT WOULD MEAN PAST/LAST FRIDAY. dim GetPastDate '** S.O.S. -> I'M STUCK HERE! <- ** %> THE FINAL OUTPUT WOULD BE: <% Response.write "Last Date for day: " &