How to save the Dataset to a new file using today's Date as filename?

Posted on 2004-10-14
Last Modified: 2010-04-23

I am using Provider=Microsoft.Jet.OLEDB.4.0 connection to load and save my database to file.

I have created datatable in a dataset. and I would like to save this datatable/dataset to a new file created using todays date as the filename.

e.g. checks if the file exist, then otherwise create a new file called "14-07-2004.mdb"

I guess the checking if the file exist is easy, but I don't how to create new file in and using the date as a filename.

Any help would be appreciate!

many many thanks.
Question by:staines
LVL 10

Expert Comment

by:Hans Langer
ID: 12314150
Hi !
You want to create a file from de dataset ?, with what format ?

Expert Comment

ID: 12316230
if you want to save it as XML then its easy


Author Comment

ID: 12317244
I mention as above, i want to create a database file using the data as "15-10-2004.mdb"

a .mdb file...

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

LVL 25

Expert Comment

ID: 12317788
Hi staines,

look here for a
LVL 25

Accepted Solution

RonaldBiemans earned 250 total points
ID: 12317792
LVL 10

Expert Comment

by:Hans Langer
ID: 12318253
nice article.

now, just change:

 cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;" & _
                 "Data Source=D:\AccessDB\NewMDB.mdb;" & _
                 "Jet OLEDB:Engine Type=5")


 cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;" & _
                 "Data Source=D:\AccessDB\"  & Now.Date.ToString("dd-MM-yyyy") & ".mdb;" & _
                 "Jet OLEDB:Engine Type=5")

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now