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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
Introduction When many people think of the WebBrowser ( control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

770 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