skip weekends and holidays

S

Sheryl

I purchased the 'Visual Basic Language Developer's Handbook' by Ken Getz and
Mike Gilbert after reading all the information from the news groups regarding
weekends and holidays, plue the links supplied. I need some help with the
area from the book about the xml file and the code. A sample xml file was on
the disk, but I can't seem to do anything with it. I am running XP. Do I
need to do anything to the code below to make it work with my database or can
you direct me somewhere so I can find the answers.

Option Explicit

' From "Visual Basic Language Developer's Handbook"
' by Ken Getz and Mike Gilbert
' Copyright 2000; Sybex, Inc. All rights reserved.

' Test procedures for the other procedures provided in this chapter.

Sub CreateHolidayXML()
' Create an XML file from the tblHolidays table.
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
rst.Open "tblHolidays", _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & CurrentProject.Path &
"\Testcodes.mdb"

' Need to delete the file, if it's already there.
On Error Resume Next
Kill CurrentProject.Path & "\Holidays.xml"
On Error GoTo 0

' Now save the XML file, based on the recordset.
rst.Save CurrentProject.Path & "\Holidays.xml", adPersistXML
rst.Close
Set rst = Nothing
End Sub
 
D

Douglas J. Steele

All the code you've shown does is make a new copy of Holidays.xml, based on
whatever holidays have been added to tblHolidays. I don't have a copy of the
book handy, so I don't know how Holidays.xml gets used by the "actual"
routines that do the calculations.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top