VBScipt: Call builtin functions shadowed by global variables

VBScript on ASP Classic contains an "int" function. (It rounds numbers towards -8.) Suppose that some excessively "clever" coder has created a global variable named "int". Is there any way to get at the original function I've tried all manner of workarounds with scoping and dodgy execs, but no dice. I suspect that it is impossible, but I'm hoping that someone will know more about it than I do. EDIT:

Posted On: Friday 17th of August 2012 11:34:58 PM Total Views:  270
View Complete with Replies

Related Messages:

Cannot use parentheses when calling a Sub   (119 Views)
I have a Classic ASP page that contains the following code to attempt a parametised query; However, the page is now reporting the following error; Cannot use parentheses when calling a Sub /welcome/default2.asp, line 436 cmdEmail.CreateParameter("@ContentID", 3, 1, , request.Form(ContentID)) -----------------------------------------------------------------------^ Is this some bug with ASP or do I need to change how I attempt parametised queries Thank you.
How do I fire an asynchronous call in asp classic and ignore the response?   (103 Views)
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", url, true '' setting the 'asynchronous' option to 'true' xmlhttp.setRequestHeader "Content-Type", "application/soap+xml; charset=utf-8" xmlhttp.setRequestHeader "Content-Length", Len(XMLData) xmlhttp.send XMLData This works peachy when calling synchronously, but when I flip the ansynchronous option to 'true', nothing fires. What I can gather from the internet is that users do something like the following: While xmlhttp.readyState 4 xmlhttp.waitForResponse 1000 Wend Am I crazy in that this does not really seem like an asynchrous call anymore though if you are waiting for a response putting the line xmlhttp.waitForResponse 1 right after the send will cause the request to fire, but again, I don't want to wait a second. Any thoughts
Can an include file identify the calling page in classic asp?   (105 Views)
I have 2 collections of asp files that are auto generated by a job. Collection 1 has a virtual path of "/collection1/" and collection 2 has a virtual path of "/collection2/". Both collections have the same asp code: Inside I have some typical html templating. However, I'd like collection 1 to have a different template than template 2. So my question, can my include file determine what page just called it so I can do a simple if statement and display a different template The easiest way may seem to change the job to render different asp, but this is not an option. edit - I can add a handler for .inc to go to classicasp.
dynamically executing classic ASP pages   (121 Views)
I'd like to store the contents of classic ASP pages in a table in a database, and have the ability to dynamically retrieve said contents and execute on the fly. Is this possible
How to access filesystem from within a .NET dll called by classic ASP?   (185 Views)
I made a .NET dll and put it in system32 folder and RegAsm it in a win2003 server. One of the API of this dll is to create a file in c:/ folder. And when I call this API from a classic ASP script, always get this error System.IO.__Error.WinIOError So the dll or asp process does not have the sufficient access privilege How to give it the write access Thank you [Edit] The dll is called in an ASP page, running in a browser. [Edit] Anyone can help
Automatically convert VBScript properties to VB.NET   (102 Views)
Migrating an old ASP site to .NET, and there's a load of VBScript we're porting to VB.NET. Getting into trouble with the old property syntax, does anyone know of a tool (or other such magic) that could do this automatically Googled, but no joy.
how to call COM object from classic ASP   (168 Views)
How to call COM object from classic ASP I tried hard but cannot find a good tutorial. Any recommendations I am using C# in classic ASP.
Looking for tutorial to call WCF service from classic ASP   (137 Views)
I have some legacy classic ASP code (not ASP.Net, but ASP), and I want to call a WCF service which I developed by using VSTS 2008 + C# + .Net 3.5 and using basic Http Binding. Any reference samples I heard the only way is -- we have to manually generate the tricky SOAP message, and parse SOAP response, is that true :-)
Invalid procedure call or argument in vbscript   (130 Views)
I am using vb script to upload a file to the server. The problem I'm having is that when I set the file to ASCII format like this... Set oFile = oFS.CreateTextFile(sPath & FileName, True, False) I get an error when the sub is called that says Invalid procedure call or argument but if I set the file to unicode Set oFile = oFS.CreateTextFile(sPath & FileName, True, True) it uploads successfully but will not open because of the incorrect encoding. The line that produces the error is this one if format is ASCII is this one oFile.Write BinaryToString(FileData) where oFile is the ASCII file I had created above Here is the source code that produces the error. It's an upload function I got off the net.. Public Sub SaveToDisk(sPath) Dim oFS, oFile Dim nIndex If sPath = "" Or FileName = "" Then Exit Sub If Mid(sPath, Len(sPath)) "\" Then sPath = sPath & "\" Set oFS = Server.CreateObject("Scripting.FileSystemObject") If Not oFS.FolderExists(sPath) Then Exit Sub Set oFile = oFS.CreateTextFile(sPath & FileName, True, False) oFile.Write BinaryToString(FileData) oFile.Close End Sub Function BinaryToString(Binary) 'Antonin Foller, 'Optimized version of a simple BinaryToString algorithm. Dim cl1, cl2, cl3, pl1, pl2, pl3 Dim L cl1 = 1 cl2 = 1 cl3 = 1 L = LenB(Binary) Do While cl1300 Then pl2 = pl2 & pl3 pl3 = "" cl3 = 1 cl2 = cl2 + 1 If cl2>200 Then pl1 = pl1 & pl2 pl2 = "" cl2 = 1 End If End If Loop BinaryToString = pl1 & pl2 & pl3 End Function Could it be configurations on the server If this makes any sense please help..
Finding connection strings in code programatically   (119 Views)
Seems like a fairly straightforward problem. I want to look through about 6gb of content and classic asp code and find anything that looks like a connection string. Problem is, the connection strings are formatted in a dozen different ways. I was thinking of using a regex to look for specific properties like "catalog=" or "password=" etc. Any thoughts/ideas
How do I programatically 301 redirect in an asp page?   (212 Views)
I'm upgrading some classic asp pages to .net, but not all of them. Rather than go and modify all the links in this backwards system, which pulls some of its links from a cms data store. I would like to take advantage of http and just remove the code our of that file, and perform a programatic 301 so that all the other pages can just be upgraded piecemeal.
Scalability issues when we are calling web services written in .NET using asp/vbscript   (107 Views)
We are currently calling web services on our application server through our web server using asp/vbscript. This works very well during low load. However during high load it can sometimes take up to 25 seconds to execute a query like below: Public Function GetValidLogon(storeKey, username) Dim req Set req = CreateObject("Microsoft.XMLHTTP") Dim soapReq soapReq = " " + _ " " + _ " " + _ " " + _ "" + _ CStr(storeKey) + _ "" + _ "" + _ CStr(username) + _ "" + _ " " + _ " " + _ "" "POST", Me.serviceAddress, False req.setRequestHeader "Content-Type", "text/xml; charset=utf-8" req.setRequestHeader "SOAPAction", Me.serviceNamespace + "GetValidLogon" req.send soapReq Set GetValidLogon = SOAPResponseTo_GetValidLogonOutput(req.responseText) End Function What do you think might be the issue Is it the code we are using to call the web services(see above) or is it just the fact that we are using vbscript/asp to call web the web services Can it be some settings in IIS... And every time, even during high load it's always fast when we are executing the web service directly on the application server.
Design Classic ASP applications to detect session expiration dynamically   (116 Views)
I've got a Classic ASP application that relies on session; if the user leaves a screen idle and then runs a form post or other operation, I'd like to know whether the session has expired. Currently I'm checking session in each page to see if it's timed out, but is there a better, dynamic, JavaScripty approach that will do what banks do and time out sessions with a notification and redirect to login
Error ASP web.config, when run locally   (84 Views)
Hi , I need to make some changes to aspx website, so I want to run it locally. I have loaded web site locally on IIS 7. I have done all configuration, now when I run it I get following error. ----------------------------------------------------- Detailed Error Information Module IIS Web Core Notification Unknown Handler Not yet determined Error Code 0x800700b7 Config Error There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined Config File \\\C:\inetpub\wwwroot\web.config ---------------------------------------------------- Config Source 4: 5: 6: I found some solution The workaround for the first scenario is to update the application-level Web.config file by including the boilerplate configuration text from a Web.config file that was generated automatically by Visual Studio 2008. but I hardly understand it, what should I do, because I am quiet new to aspx. Thank you
How do I run .ASP (ASP Classic) pages locally (on my development PC) for testing, etc.?   (155 Views)
I'm working on some old .asp pages. I mostly do VB development so I'm a newbie to .ASP. How can I run those pages locally for testing I'm running Windows XP Home SP2. I'm guessing I'll need to install a local server, etc.
Can use ASP to call PHP soap?   (92 Views)
My customer has a PHP web service, that they want me to use. It's PHP-based, while my web is ASP-based. The ASP code looks like this: Dim soapclient WSDL_URL = "http://xxx.xxxx.xx/index.phpAction=service" set soapclient = Server.CreateObject("MSSOAP.SoapClient30") soapclient.ClientProperty("ServerHTTPRequest") = True on error resume next soapclient.mssoapinit WSDL_URL ' error here Is ASP able to call a PHP-based soap service or What should I adjust
How can I dynamically update a variable in plain html files in on windows web server   (135 Views)
We have some old html files on the website that have copyright year on the bottom of the page (from include file). We are trying to find a way to update that dynamically to current year so the include file does not need to be edited every year. We are using asp and .net on the same server so there might be ways to use those technologies to accomplish this. I am thinking of several ways this could be possibly accomplished but I am sure I am missing something. Maybe some sort of token replacement that could be done or something. Here are few options that I am thinking about. A process on the server that will check for year change once a day and rewrite the include files or would be triggered once a year by a scheduled task. A web application that when accessed would check out the current year and write it to include files. It would need a permission to write to the disk. Then access it with something like wget with a scheduled task once a year or manually when it is time. Embed the javascript as part of the non-asp include files that would update the year dynamically before pages finish loading. This is among the easiest ways to accomplish this, but probably not the best. Finding a way to process files before they are embedded. Enable asp processing on html files. This is undeeable due to server load it might cause.
VBScript - General - Error - Call vbscipt function on html onsubmit   (75 Views)
In a html form onsubmit="return validate()", can i call validate function which is in VBscript. If yes, can u provide a sample. If no, what other method should i use
VBScript - General - Error - Call vbscipt function on html onsubmit   (76 Views)
In a html form onsubmit="return validate()", can i call validate function which is in VBscript. If yes, can u provide a sample. If no, what other method should i use
html form vbscipt and excel problem   (124 Views)
I am trying to convert the following VBSCRIPT code to a loop! I have the following code working perfectly but would like to loop through other parts of the worksheet for other data. See my current working program. Notice I am just going through row 1 for data in column 1, 2, 3. I would like to make this part to be driven from my loop. Set objExcel = CreateObject("Excel.Application") strPathExcel = document.dir.xlsPath.value strPathExcel Set objSheet = objExcel.ActiveWorkbook.Worksheets(1) strCN = Trim(objSheet.Cells(1, 1).Value) document.Form2.SiteName.value = strCN strCN = Trim(objSheet.Cells(1, 2).Value) document.Form2.City.value = strCN strCN = Trim(objSheet.Cells(1, 3).Value) document.Form2.Address.value = strCN objExcel.Workbooks.Close end if I would like ot do something similiar to this. Why will this not work for i = 33 to 35 cid = "" & i & ".Value" strCN = "Trim(objSheet.Cells(" & i & ", 2).Value)" cid = strCN next