ASP Classic FAQ Page

These FAQs are contributed by you (our online community members). They are organized by our knowledge base topics. Specifically, by the ASP Classic sub-topics.

Expand All

4 ASP Classic Coding FAQs

Group: ASP Classic Coding


Topic: ASP Classic

-Collapse +Expand Q1. How do you find last Monday? I want to return a date for last Monday or today if today is Monday.
 
Answer:
While Weekday(ADate) <> vbMonday
     ADate = DateAdd("d", -1, ADate)
WEnd

You could wrap this up in a function as follows: 

Function SU_GetLastDOW(ADate, AWeekDayConst)
    While Weekday(ADate) <> AWeekDayConst
        ADate = DateAdd("d", -1, ADate)
    WEnd
    
    SU_GetLastDOW = ADate
End Function
-Collapse +Expand Q2. What does VBScript stand for?
 
Answer: VBScript is short for Visual Basic Scripting. VBScript brings scripting to a wide variety of environments, including Web client scripting in Microsoft Internet Explorer and Web server scripting in Microsoft Internet Information Service. It is used in Visual Basic, Access, Word, Excel, ASP, etc.



Topic: Tool Basics

-Collapse +Expand Q3. Can you edit Access and MS SQL Server views?
 
Answer:

Although this question really depends on the provider, in general, the answer is no to MS Access views and yes to MS SQL Server views so long as you open the RecordSet editable.




Topic: Language Details

-Collapse +Expand Q4. What is the syntax in ASP Classic for using an associative array?
 
Answer:

Use a dictionary:

Dim StateList
 
set StateList = Server.CreateObject("Scripting.Dictionary")
StateList.Add "CA", "California"
 
Response.Write "NV is " & StateList("NV")

For more examples, refer to our ASP Classic Associative Array (Scripting.Dictionary) article.

www.prestwood.com For service: 916-726-5675
or support@prestwood.com
Copyright (C) Prestwood IT Solutions.
All Rights Reserved.
Printed 6/5/2020