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
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