Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-23-2006, 03:26 PM   PM User | #1
parallon
Regular Coder

 
Join Date: May 2005
Posts: 215
Thanks: 14
Thanked 0 Times in 0 Posts
parallon is an unknown quantity at this point
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
parallon is offline   Reply With Quote
Old 03-25-2006, 05:58 PM   PM User | #2
miranda
Senior Coder

 
Join Date: Dec 2002
Location: Arlington, Texas USA
Posts: 1,062
Thanks: 4
Thanked 8 Times in 8 Posts
miranda is an unknown quantity at this point
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...
miranda is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:53 AM.


Advertisement
Log in to turn off these ads.