5 replies
by andrew
An easy way is to use ASP. Here's an entire ASP page that reads data from an Access DB and generates a web page:
<%@ Language=VBScript %>
<%Option Explicit%>
<%
Dim sDSN
Dim oCon
Dim oRS
on error resume next
sDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:db1.mdb;"
Set oCon = Server.CreateObject("ADODB.Connection")
Set oRS = Server.CreateObject("ADODB.Recordset")
oCon.Open sDSN
oRS.Open "SELECT * FROM Table1", oCon
Do
Response.Write oRS.Fields("Name").Value & " " & oRS.Fields("Status").Value & "
"
oRS.MoveNext
Loop until oRS.EOF
%>
Here'sa link to more about ASP:
http://msdn.microsoft.com/asp
by barry
by andrew
In answer to your second question, you can use the DateDiff() function. The built-in weekday function doesn't work, so here's an algorithm that returns the weekday interval between 2 dates:
Function DateDiffW(BegDate, EndDate)
Const SUNDAY = 1
Const SATURDAY = 7
Dim NumWeeks As Integer
If BegDate > EndDate Then
DateDiffW = 0
Else
Select Case Weekday(BegDate)
Case SUNDAY: BegDate = DateAdd("d", 1, BegDate)
Case SATURDAY: BegDate = DateAdd("d", 2, BegDate)
End Select
Select Case Weekday(EndDate)
Case SUNDAY: EndDate = DateAdd("d", -2, EndDate)
Case SATURDAY: EndDate = DateAdd("d", -1, EndDate)
End Select
NumWeeks = DateDiff("ww", BegDate, EndDate)
DateDiffW = NumWeeks * 5 + Weekday(EndDate) - Weekday(BegDate)
End If
End Function
by barry
by barry
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending