asp-classic

classic asp stored procedures parameters

自古美人都是妖i 提交于 2019-12-07 09:40:05
问题 I've been looking around how to call a stored procedure from classic asp and pass a parameter into it below is my stored procedure which works fine CREATE PROCEDURE Paging_Movies @alphaChar char(1) AS if @alphaChar = '#' select * from Movies where movies like '[^a-z]%' else select * from Movies where movies like @alphaChar + '%' and my vbscript code so far - Set objCon = CreateObject("ADODB.Connection") Set objRS = CreateObject("ADODB.Recordset") set objComm = CreateObject("ADODB.Command")

Classic ASP session to MVC session

蹲街弑〆低调 提交于 2019-12-07 08:46:27
Is it possible to set a session in Classic ASP and use it in an MVC project? I have taken over a project for a company and they have original website in MVC and they the new feature I am adding needs to be in MVC, I am not able to convert the classic ASP to MVC because it would require to much time. So I am looking for a solution where I can set a session in ASP and use it in MVC. Currently I am setting a session by passing in an ID through a URL to the first MVC page they visit. Which looks like: <a href="MyMvcPage/1"> MVC Home Page </a> When I go to the page, I fetch the parameter from the

How can I set breakpoints in Classic ASP? (IIS7/VS2010)

↘锁芯ラ 提交于 2019-12-07 07:25:38
问题 I have a hybrid ASP.NET/classic ASP application and I'd like to be able to set breakpoints in the ASP code. Is this possible? Running IIS7 on Win7 with VS2010 Ultimate. 回答1: In VBScript, the Stop statement can be used to trigger a breakpoint. Response.Write "a line" Stop Response.Write "a line after the breakpoint I'm assuming that this is a local IIS7 instance that you want to debug. On my computer, when I try to load a sample page that has a Stop statement, I get the Visual Studio Just-In

How to format a datetime with minimal separators and timezone in VBScript?

那年仲夏 提交于 2019-12-07 07:05:06
问题 I have the following code in C#: DateTime dt = GetDateTime(); string formatted = dt.ToString("yyyyMMddTHHmmsszz"); which returns a date in the following format: 20100806T112917+01 I would like to be able to get the same results in VBScript (for a legacy ASP application). It is especially important that I get the UTC offset information, or have the time converted to UTC. How do I do that? 回答1: For date formatting, I like using the .NET StringBuilder class from VBScript: Option Explicit Dim sb

ASP Classic - Recordset Object vs. Command Object

岁酱吖の 提交于 2019-12-07 07:03:26
问题 I am using ASP Classic and SQL Server 2000 to create dynamic websites. I am a bit confused about when to use a recordset object and when to use a command object when querying the database. I was told that if the stored procedure would be returning records from a SELCT statement then I should use a recordset, however if I am up updating or inserting then I should use a command object and pass all data as parameters to the stored procedure. When using a recordset I often pass any required data

Access Database LIMIT keyword

笑着哭i 提交于 2019-12-07 05:04:47
问题 I'm trying to get my page listing function working in ASP with an Access database, but I don't know the alternative to LIMIT in Microsoft SQL. I have tried TOP but this doesn't seem to be working. Here is the statement am using with MySQL: SELECT * FROM customers ORDER BY customerName DESC LIMIT 0, 5 How can I convert this to work with Access Database? 回答1: According to ms-access view: SELECT TOP(5) * FROM customers ORDER BY customerName; will fetch an error "The SELECT statement includes a

VBScript ISO8601

痞子三分冷 提交于 2019-12-07 04:58:46
问题 In VBScript, does FormatDateTime have ISO 8601 support? If not, how would I write such function with it? For example: Response.Write FormatAsISO8601(#05/04/2011#) Function FormatAsISO8601(datetime) ... End Function 回答1: Here is the specific code I needed from Chris' class, a bit more optimized: Public Function ToIsoDateTime(datetime) ToIsoDateTime = ToIsoDate(datetime) & "T" & ToIsoTime(datetime) & CurrentTimezone End Function Public Function ToIsoDate(datetime) ToIsoDate = CStr(Year(datetime

Diagnosing HTTP 500 errors in Classic ASP

感情迁移 提交于 2019-12-07 04:41:07
问题 I have recently inherited a website written in Classic ASP, and am currently trying to get a sense of the state of things. The website is working in production, however the development environment (hosting on a Windows Server 2003 box) produces an HTTP 500 error when you try to navigate to it. I realize that HTTP 500 errors just mean that an unexpected server error occurred, and that this also is more than likely the ASP code crashing for one reason or another. I have tried numerous browsers

Convert Time to UTC vbScript

早过忘川 提交于 2019-12-07 02:32:22
问题 I have the following function which does fine at converting current time to UTC time. Function toUtc(byVal dDate) Dim oShell : Set oShell = CreateObject("WScript.Shell") toUtc = dateadd("n", oShell.RegRead("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation\ActiveTimeBias"), cDate(dDate)) End Function However, I am thinking that this does not adequately handle conversion of future or historical dates to UTC, since the function would need to know the offset of the server's

How do I get root url using ASP not ASP.net

北城余情 提交于 2019-12-07 02:09:18
问题 How do I get root url using ASP not ASP.net? I have found this question ( How do I get the site root URL? ) but it is related to ASP.net. ===================================== Abbas's answer provide me the parent site root url but does not provide me the subsite root url ===================================== 回答1: Classic ASP had a Request.ServerVariables collection that contained all server and environment details. Here's what the classic ASP version of the example .NET code looks like: