asp-classic

Can someone make this a single query?

自闭症网瘾萝莉.ら 提交于 2019-12-11 12:43:26
问题 So I was just searching how to do an "INSERT INTO" query and found this: sql="INSERT INTO Customers (ID,firstName," sql=sql & "lastName)" sql=sql & " VALUES " sql=sql & "('" & Request.Form("id") & "'," sql=sql & "'" & Request.Form("firstname") & "'," sql=sql & "'" & Request.Form("lastname") & "')" I know it works but I want to make it a single query without all the sql=sql's 回答1: You took the route of a quick hack as stated in your comments by doing rhis: sql="INSERT INTO Customers (ID

Setting HTTP_X_FORWARDED_FOR server variable in classic ASP

橙三吉。 提交于 2019-12-11 12:42:56
问题 I need to set the HTTP_X_FORWARDED_FOR value in the Request.ServerVariables collection. I'm trying with Fiddler (see this article). So I set up a custom HTTP request: GET http://myhost/ HTTP/1.1 http_x_forwarded_for: my.fake.ip.1, my.fake.ip.2 Host: myhost. The request is correctly executed. But when I debug the code, the Request.ServerVariables("HTTP_X_FORWARDED_FOR") is empty. Where am I wrong? Is Fiddler the correct tool? 回答1: The header you are sending should be x-forwarded-for . The

Connecting to an Access database in Classic ASP using an ADODB object

冷暖自知 提交于 2019-12-11 12:33:03
问题 I am new to classic ASP. I would rather ask question than do hour of research to solve my problem. I am accessing access database and getting the following error. Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified /default1.asp, line 30 The culprit line is this Set MyConn = Server.CreateObject("ADODB.Connection") MdbFilePath = Server.MapPath("c:\database\MyDatabase.mdb") Well, I do not have

Encrypt in VBScript/ASP Classic, Decrypt in PHP?

北慕城南 提交于 2019-12-11 12:31:57
问题 I'm looking to encrypt a string in VBScript, and decrypt it in PHP. I have full control over the VBScript/ASP Classic environment, but zero control over my PHP environment. Given this, what sort of encryption could I use that would be adequate enough to secure a string? Apologies for the vagueness of the question, but I do not know where to begin. 回答1: The first thing you should try is simply using a standard encryption/decryption algorithm. The problem is that these are handled by the php

Date format in asp to excel form

送分小仙女□ 提交于 2019-12-11 12:19:02
问题 This is my original query, when i save my data records to excel file the date format from dd/mm/yyyy to d/m/yyyy, what can i do to change to the excel date format? Hope someone can help me..thanks ya..i hope the date can be dd/mm/yyyy. strSQL2= "select DISTINCT to_char(PROD,'dd/mm/yyyy') as PROD_FORMATTED, to_char(PRAD,'dd/mm/yyyy') as PRAD_FORMATTED,PROD,PRAD, BRCH,DEPT,SANO,SUBM, to_char(SUBD,'dd/mm/yyyy') as SUBD, STAT, PSFG, TSAM, TLEV, CLEV, GROP, CTLV, CCLV, CRNM, EXFL FROM SANCTH " & _

How do I get a variable to work within double quotes in ASP-classic?

霸气de小男生 提交于 2019-12-11 12:17:55
问题 The following code is part of a function that is being called for each file the program finds during it's search through a directory. set searchname = objFSO.OpenTextFile(server.mappath(filename),1, true) do until searchname.AtEndOfStream lineData = lcase(searchname.ReadLine()) if instr(lineData,s)>0 then instances = instances + 1 end if Loop This the part of my code I'm confused with. This code worked perfectly yesterday. I made a few edits but mostly with HTML and CSS. When I pulled this

ASP Classic recordset unable to see columns with 'table.column_name' format after MySQL conversion

巧了我就是萌 提交于 2019-12-11 11:57:47
问题 I am currently in the process of converting a large amount of ASP classic/VBscript pages from an old database (Unify Dataserver) to MySQL. Say you have a query like this: sql = "SELECT c.container_type, c_amount, c_sdate, c_edate, csrt " & _ "FROM containers c, container_chars cc" objRS.Open sql, objConn, 3, 1 If I want to reference the column "c_edate", I can simply use this and it works fine: x = objRS("c_edate") However, when it comes to referencing a column like "c.container_type" (With a

ASP : File download of ASP page comes instead of executing it

那年仲夏 提交于 2019-12-11 11:54:39
问题 I have an ASP page which will create a record set from an SQL query and create an excel page using that by using Response.ContentType = "application/vnd.ms-excel" property being set. When executing the file,it will show a save dialog for an excel file (whatever filename i have mentioned in Response.AddHeader) as Response.AddHeader "Content-Disposition", "attachment; filename=" & strFileName This works well in local .But when running from the server (i checked only in IE ),ITs showing me a

paypal classic asp msxml error on windows server 2008

五迷三道 提交于 2019-12-11 11:42:43
问题 The following routine works fine from my Win 2003 server to send a pay request to Paypal. Set vXMLHttp = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0") vXMLHttp.setOption(3) = CERT_PATH strURL = KEYPOINT &"/AdaptivePayments/Pay" vXMLHttp.open "POST", strURL, false vXMLHttp.setRequestHeader "X-PAYPAL-SECURITY-USERID", API_USERNAME vXMLHttp.setRequestHeader "X-PAYPAL-SECURITY-PASSWORD", API_PASSWORD 'vXMLHttp.setRequestHeader "X-PAYPAL-SECURITY-SIGNATURE", API_SIGNATURE vXMLHttp

ASP Mail Error: The event class for this subscription is in an invalid partition

六月ゝ 毕业季﹏ 提交于 2019-12-11 11:34:10
问题 I have some ASP code that I've "inherited" from my predecessor (no, it's not an option to update it at this time...It would take an act of not only Congress, but every other foreign country too) and I'm having an issue sending mail on one of the pages. It is an almost identical code snippet from the other page, but this one throws an error when I try to 'Send'. Code below: Set myMail=CreateObject("CDO.Message") myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration