asp-classic

ServerXMLHTTP appending to content-type

江枫思渺然 提交于 2019-12-19 09:23:13
问题 I am making a server-side HTTP request with a JSON body in VBScript like this: Set oXMLHttp = Server.CreateObject("MSXML2.ServerXMLHTTP") oXMLHttp.open cMethod, cAPIURL, False, cUser, cPassword oXMLHttp.setRequestHeader "Content-Type", "application/json" oXMLHttp.send(cData) cReturn = oXMLHttp.responseText Set oXMLHttp = Nothing The service I'm calling expects the content-type to be application/json , naturally. As you can see, I'm setting the request header above to be as such. The issue is

Return resultset from oracle 11g stored procedure using classic asp

烂漫一生 提交于 2019-12-19 08:55:53
问题 We recently upgraded from Oracle 10g to 11g and now the microsoft provider MSDAORA.1 won't work. I've changed to using the OraOLEDB.Oracle provider but now one of my stored procedures that is returning a resultset isn't going to work either. Old Call: strSQL = "{call SYSADM.lss_pkg_catalog_pages.get_catalog_pages(?,{resultset 100, lss_media_cd, lss_page_num})}" So I've been trying to change it to return parameter values but I keep getting the following error: Error: -2147217900 - ORA-06550:

Troubleshooting a Parameterized SQL Statement in asp

醉酒当歌 提交于 2019-12-19 08:22:31
问题 I'm trying to secure some legacy code written in what I guess is VB or asp(Not really sure if there is a difference). When I try to execute the statement the page gets an internal server error. I'm convinced this is a result of the connection but I don't know the language well enough to know how to troubleshoot it. What I know of the language and the ADODB library has come from W3Schools documentation and this post. Here is the code I have written (Identifying information redacted) SET Conn

Application uses a value of the wrong type for the current operation in classic asp

久未见 提交于 2019-12-19 07:09:10
问题 I am calling one stored procedure using the following code: m_objCmd.CommandText = "StoredProc_Name" m_objCmd.Parameters.Append m_objCmd.CreateParameter("@UserID", 3, 1, 0, UserID) m_objCmd.Parameters.Append m_objCmd.CreateParameter("@UserTypeID", 3, 1, 0, UserTypeID) m_objCmd.Parameters.Append m_objCmd.CreateParameter("@AccessToken", 202, 1, 100, AccessToken) m_objCmd.Parameters.Append m_objCmd.CreateParameter("@TokenExpiration", 135, 1, 0, TokenExpiration) m_objCmd.Parameters.Append m

Oracle (0x80004005)ORA-12154: TNS:could not resolve the connect identifier

本秂侑毒 提交于 2019-12-19 06:28:11
问题 I'm trying to connect to an oracle db from an ASP classic application, however I keep running into the ORA-12154 error. TNSNAMES.ORA is configured properly DBSOURCE.A.B.com = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = C.D.B.com)(PORT = 1231)) ) (CONNECT_DATA = (SERVICE_NAME = DBSOURCE) ) ) I can TNSPING C:\Documents and Settings\USERID.A>tnsping DBSOURCE TNS Ping Utility for 32-bit Windows: Version 10.2.0.4.0 - Production on 09-MAR-2 011 09:12:31 Copyright (c) 1997,

Return more than one value from a function

北城以北 提交于 2019-12-19 04:18:21
问题 UPDATE: This is the WIP Function. <% Function ReturnTwoValues(Data) If Data= Now() Then Var1= "ABC" Var2= "000" Else Var1= "CDE" Var2= "111" End If ReturnTwoValues = Array(Var1, Var2) End Function a = ReturnTwoValues(Data) Value1= a(0) Value2= a(1) %> My doubt now is: How can I invoke the function? If I do Response.Write Value1 and Response.Write Value2 I can get the value, but I need to pass the parameter first. Something like ReturnTwoValues(Now()) , but if I do it, how could I be able to

classic ASP protection against SQL injection

烈酒焚心 提交于 2019-12-19 04:06:13
问题 I've inherited a large amount of Classic ASP code that is currently missing SQL injection protection, and I'm working on it. I've examined in detail the solutions offered here: Classic ASP SQL Injection Protection On the database side, I have a Microsoft SQL server 2000 SP4 Unfortunately stored procedures are not an option. After studying php's mysql_real_escape_string ( http://www.w3schools.com/php/func_mysql_real_escape_string.asp ) , I've replicated its functionality in ASP. My question(s)

Error when Request.QueryString is empty

徘徊边缘 提交于 2019-12-19 04:02:11
问题 Sometimes users mistakenly redirected to ?Process=ViewImages&PAGEID=. When this happens, they get the following error. Microsoft VBScript runtime error '800a000d' Type mismatch: '[string: ""]' /FLPM/cp/images.cs.asp, line 91 I tried to fix it with the following codes but still get the same error. PAGEID = Request.QueryString("PAGEID") If PAGEID = "" or PAGEID = NULL or PAGEID = 0 Then PAGEID = 1 End If 回答1: if IsNumeric(pageId) and pageId <> "" then pageId = Cint(pageId) else pageId = 1 end

Select Query on 2 tables, on different database servers

爷,独闯天下 提交于 2019-12-19 03:43:12
问题 I am trying to generate a report by querying 2 databases (Sybase) in classic ASP. I have created 2 connection strings: connA for databaseA connB for databaseB Both databases are present on the same server (don't know if this matters) Queries: q1 = SELECT column1 INTO #temp FROM databaseA..table1 WHERE xyz="A" q2 = SELECT columnA,columnB,...,columnZ FROM table2 a #temp b WHERE b.column1=a.columnB followed by: response.Write(rstsql) <br> set rstSQL = CreateObject("ADODB.Recordset")<br> rstSQL

XML and ASP: Retrieve and parse a remote file

淺唱寂寞╮ 提交于 2019-12-19 03:42:16
问题 I'm building a site on a Windows Server with ASP enabled. I need to retrieve an XML document from another server and return a value in that document. The xml file is small - only one node with a text value. I just need to return that text value. I've never worked with ASP before, and Googling around has led me to some code examples, but nothing that works so far. Here's what I've got, which gives me a 500: <% Dim URL, objXML URL = "http://someserver.com/xml" Set objXML = Server.CreateObject(