Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    May 2005
    Posts
    215
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Transfer vbscript from Access to ASP

    Hello all,

    We have a current application written in the backend of Access using vbscript, and we are trying to bring this application to the web. There is a function/subroutine in the program which I need, and I was wondering what sort of alterations to the code would be needed to include this in my ASP pages? I tried the copy and paste, with no prevail. I am under the impression that vbscript can be used in ASP.

    Code in MS Access:
    Code:
      Private Sub ThisWeek_Click()
          Ago = Weekday(Now, 1)
    
    If Ago = 1 Then
        StartDate = Date() - 3 - Ago
        'Date = Now - 3 - Ago
        EndDate = StartDate + 6
        Else
            If Ago = 2 Then
                StartDate = Now - 3 - Ago
                'Date = Now - 3 - Ago
                EndDate = StartDate + 6
                Else
                    If Ago = 3 Then
                        StartDate = Now - 3 - Ago
                        'Date = Now - 3 - Ago
                        EndDate = StartDate + 6
                        Else
                            StartDate = Now + 4 - Ago
                            'Date = Now + 4 - Ago
                            EndDate = StartDate + 6
                    End If
            End If
    End If
    
    Me![StartDate].Value = Month([StartDate]) & "/" & Day([StartDate]) & "/" & Year([StartDate])
    Me![EndDate].Value = Month([EndDate]) & "/" & Day(Me![EndDate]) & "/" & Year(Me![EndDate])
    Me![EmpName].SetFocus
       End Sub
    There are a couple other routines that I need also, but if I could just get an idea of the difference in the format, I think I could go from there.

    Thanks in advance,

    Parallon

  • #2
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,072
    Thanks
    4
    Thanked 8 Times in 8 Posts
    Yes you can use VBScript in ASP in fact it is the default language if there is no language specified in the @ statement.

    However, you have to keep in mind that in classic asp there is no server side click event that can be used. Many of the things that are available for use in VBScript that is done on the client side are not available for use in ASP pages where the operation is done on the server. like the click event, MsgBox etc...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •