Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
03-23-2006, 03:26 PM #1
- Join Date
- May 2005
- Thanked 0 Times in 0 Posts
Transfer vbscript from Access to ASP
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:
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
Thanks in advance,
03-25-2006, 05:58 PM #2
- Join Date
- Dec 2002
- Arlington, Texas USA
- Thanked 9 Times in 9 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...