473,799 Members | 3,081 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I need a folder browser to backup database

I'd like a button on my main form to backup the database. How can I call up
the Windows folder browser to prompt me for a filename and type (*.mdb) and
folder to save in? I looked in my book and didn't see anything like that.
I only want to backup the data tables in the back-end database. Is there
some standard set of code to do this?

Thanks, Rich Hollenbeck
Nov 13 '05 #1
6 1674
See http://www.mvps.org/access/api/api0001.htm at "The Access Web

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Richard Hollenbeck" <ri************ ****@verizon.ne t> wrote in message
news:nUyfd.3856 $jD4.3074@trndd c06...
I'd like a button on my main form to backup the database. How can I call up the Windows folder browser to prompt me for a filename and type (*.mdb) and folder to save in? I looked in my book and didn't see anything like that.
I only want to backup the data tables in the back-end database. Is there
some standard set of code to do this?

Thanks, Rich Hollenbeck

Nov 13 '05 #2
Thanks, Doug. You pointed my in the right direction but I suspect that
http://www.mvps.org/access/api/api0026.htm may be a little closer to what
I'm looking for. I copied the module into the clipboard then pasted it into
a new module I called, "basFMakeBackup ."

inside the command button's code I simply typed fMakeBackup(). I got the
error, "Expected ="
I don't know how to use this. I tried currentDB = fMakeBackup. I got the
error, "Invalid use of property."

Unfortunately, this apparently excellent little module didn't come with any
explanation. I guess the idea is that if I don't know enough to figure it
out by myself, I probably shouldn't use it. I won't sit around and wait for
a reply but I'll continue trying to figure it out. But if you choose to
reply with a hint about how this module works, I thank you in advance!
Thank you!

Also, I would like to modify it to build a string based on now() (for
example, "20041027_backu p.mdb") and append that to the new file name instead
of just "Copy of (?)" That way all backups will automatically have a name
that reflects the date and will automatically be sorted by date.

Rich Hollenbeck

"Douglas J. Steele" <NOSPAM_djsteel e@NOSPAM_canada .com> wrote in message
news:Nd******** ************@ro gers.com...
See http://www.mvps.org/access/api/api0001.htm at "The Access Web

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Richard Hollenbeck" <ri************ ****@verizon.ne t> wrote in message
news:nUyfd.3856 $jD4.3074@trndd c06...
I'd like a button on my main form to backup the database. How can I call
up
the Windows folder browser to prompt me for a filename and type (*.mdb)

and
folder to save in? I looked in my book and didn't see anything like

that. I only want to backup the data tables in the back-end database. Is there some standard set of code to do this?

Thanks, Rich Hollenbeck


Nov 13 '05 #3
An example I'm working on to change the file name of the resulting backup
file goes like this:

Private Sub cmdBackupDataba se_Click()
Dim datVarDate
Dim datDate As Date
Dim strNewFileName As String

datDate = Now()
strNewFileName = year(datDate) & Month(datDate) & Day(datDate) &
"Backup.mdb "
'Results in something like, "20041027Backup .mdb" -- this part works.
End Sub

Now I need to figure out how to modify the fMakeBackup() module (found at
http://www.mvps.org/access/api/api0026.htm) to make this change, and then
how to use the module.

"Richard Hollenbeck" <ri************ ****@verizon.ne t> wrote in message
news:riRfd.5208 $8R.2554@trnddc 02...
Thanks, Doug. You pointed my in the right direction but I suspect that
http://www.mvps.org/access/api/api0026.htm may be a little closer to what
I'm looking for. I copied the module into the clipboard then pasted it into a new module I called, "basFMakeBackup ."

inside the command button's code I simply typed fMakeBackup(). I got the
error, "Expected ="
I don't know how to use this. I tried currentDB = fMakeBackup. I got the
error, "Invalid use of property."

Unfortunately, this apparently excellent little module didn't come with any explanation. I guess the idea is that if I don't know enough to figure it
out by myself, I probably shouldn't use it. I won't sit around and wait for a reply but I'll continue trying to figure it out. But if you choose to
reply with a hint about how this module works, I thank you in advance!
Thank you!

Also, I would like to modify it to build a string based on now() (for
example, "20041027_backu p.mdb") and append that to the new file name instead of just "Copy of (?)" That way all backups will automatically have a name
that reflects the date and will automatically be sorted by date.

Rich Hollenbeck

"Douglas J. Steele" <NOSPAM_djsteel e@NOSPAM_canada .com> wrote in message
news:Nd******** ************@ro gers.com...
See http://www.mvps.org/access/api/api0001.htm at "The Access Web

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Richard Hollenbeck" <ri************ ****@verizon.ne t> wrote in message
news:nUyfd.3856 $jD4.3074@trndd c06...
I'd like a button on my main form to backup the database. How can I call
up
the Windows folder browser to prompt me for a filename and type
(*.mdb) and
folder to save in? I looked in my book and didn't see anything like

that. I only want to backup the data tables in the back-end database. Is there some standard set of code to do this?

Thanks, Rich Hollenbeck



Nov 13 '05 #4
The function returns a Boolean value (True if successful, False otherwise).
You have a few options.

One is to assign the results of the database to a variable:

Dim booReturn As Boolean

booReturn = fMakeBackup()

Another is simply to check the value that's returned in an If statement:

If fMakeBackup() Then
MsgBox "Backup Successful"
Else
MsgBox "Backup Failed"
End If

A third is to use the Call verb:

Call fMakeBackup

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Richard Hollenbeck" <ri************ ****@verizon.ne t> wrote in message
news:riRfd.5208 $8R.2554@trnddc 02...
Thanks, Doug. You pointed my in the right direction but I suspect that
http://www.mvps.org/access/api/api0026.htm may be a little closer to what
I'm looking for. I copied the module into the clipboard then pasted it into a new module I called, "basFMakeBackup ."

inside the command button's code I simply typed fMakeBackup(). I got the
error, "Expected ="
I don't know how to use this. I tried currentDB = fMakeBackup. I got the
error, "Invalid use of property."

Unfortunately, this apparently excellent little module didn't come with any explanation. I guess the idea is that if I don't know enough to figure it
out by myself, I probably shouldn't use it. I won't sit around and wait for a reply but I'll continue trying to figure it out. But if you choose to
reply with a hint about how this module works, I thank you in advance!
Thank you!

Also, I would like to modify it to build a string based on now() (for
example, "20041027_backu p.mdb") and append that to the new file name instead of just "Copy of (?)" That way all backups will automatically have a name
that reflects the date and will automatically be sorted by date.

Rich Hollenbeck

"Douglas J. Steele" <NOSPAM_djsteel e@NOSPAM_canada .com> wrote in message
news:Nd******** ************@ro gers.com...
See http://www.mvps.org/access/api/api0001.htm at "The Access Web

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Richard Hollenbeck" <ri************ ****@verizon.ne t> wrote in message
news:nUyfd.3856 $jD4.3074@trndd c06...
I'd like a button on my main form to backup the database. How can I call
up
the Windows folder browser to prompt me for a filename and type
(*.mdb) and
folder to save in? I looked in my book and didn't see anything like

that. I only want to backup the data tables in the back-end database. Is there some standard set of code to do this?

Thanks, Rich Hollenbeck



Nov 13 '05 #5
Hats off to you! I appreciate all the help you give to all of us. It
works, but I want to backup the back-end file (where all the data is.) I
guess I'll put the module in that database and run it automatically once a
week(or every day deleting older copies.)

"Douglas J. Steele" <NOSPAM_djsteel e@NOSPAM_canada .com> wrote in message
news:9O******** ************@ro gers.com...
The function returns a Boolean value (True if successful, False otherwise). You have a few options.

One is to assign the results of the database to a variable:

Dim booReturn As Boolean

booReturn = fMakeBackup()

Another is simply to check the value that's returned in an If statement:

If fMakeBackup() Then
MsgBox "Backup Successful"
Else
MsgBox "Backup Failed"
End If

A third is to use the Call verb:

Call fMakeBackup

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Richard Hollenbeck" <ri************ ****@verizon.ne t> wrote in message
news:riRfd.5208 $8R.2554@trnddc 02...
Thanks, Doug. You pointed my in the right direction but I suspect that
http://www.mvps.org/access/api/api0026.htm may be a little closer to what
I'm looking for. I copied the module into the clipboard then pasted it

into
a new module I called, "basFMakeBackup ."

inside the command button's code I simply typed fMakeBackup(). I got the
error, "Expected ="
I don't know how to use this. I tried currentDB = fMakeBackup. I got the error, "Invalid use of property."

Unfortunately, this apparently excellent little module didn't come with

any
explanation. I guess the idea is that if I don't know enough to figure it out by myself, I probably shouldn't use it. I won't sit around and wait

for
a reply but I'll continue trying to figure it out. But if you choose to
reply with a hint about how this module works, I thank you in advance!
Thank you!

Also, I would like to modify it to build a string based on now() (for
example, "20041027_backu p.mdb") and append that to the new file name

instead
of just "Copy of (?)" That way all backups will automatically have a name that reflects the date and will automatically be sorted by date.

Rich Hollenbeck

"Douglas J. Steele" <NOSPAM_djsteel e@NOSPAM_canada .com> wrote in message
news:Nd******** ************@ro gers.com...
See http://www.mvps.org/access/api/api0001.htm at "The Access Web

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Richard Hollenbeck" <ri************ ****@verizon.ne t> wrote in message
news:nUyfd.3856 $jD4.3074@trndd c06...
> I'd like a button on my main form to backup the database. How can I

call
up
> the Windows folder browser to prompt me for a filename and type

(*.mdb) and
> folder to save in? I looked in my book and didn't see anything like

that.
> I only want to backup the data tables in the back-end database. Is

there
> some standard set of code to do this?
>
> Thanks, Rich Hollenbeck
>
>



Nov 13 '05 #6
Hi Dennis,

I solved the date string thing something like this:

Private Sub cmdBackupDataba se_Click()
Dim datDate As Date
Dim strNewFileName As String
datDate = Now()
strNewFileName= year(datDate)&M onth(datDate)&D ay(datDate)&"Ba ckup.mdb"
'Results in something like, "20041027Backup .mdb" -- this part works.
End Sub

Now I just need to get this little snippet of code into the fMakeBackup
module, instead of in my backup subroutine.

I got the module to work okay by putting it in a select case and a boolean
case 1 and case 0 thing with a message box. It worked fine. I just don't
like the "copy of (?)" stuff.
"Dennis Lee Bieber" <wl*****@ix.net com.com> wrote in message
news:mt******** *************** *********@4ax.c om...
On Wed, 27 Oct 2004 17:55:35 GMT, "Richard Hollenbeck"
<ri************ ****@verizon.ne t> declaimed the following in
comp.databases. ms-access:


inside the command button's code I simply typed fMakeBackup(). I got the
error, "Expected ="
I don't know how to use this. I tried currentDB = fMakeBackup. I got the error, "Invalid use of property."

From the web page:

Function fMakeBackup() As Boolean

fMakeBackup returns a Boolean status code

status = fMakeBackup()

would be a usage, though I don't know how to make use of a return value
from a command button.

Also, I would like to modify it to build a string based on now() (for
example, "20041027_backu p.mdb") and append that to the new file name instead of just "Copy of (?)" That way all backups will automatically have a name that reflects the date and will automatically be sorted by date.

lngFlags = FOF_SIMPLEPROGR ESS Or _
FOF_FILESONLY Or _
FOF_RENAMEONCOL LISION
strSaveFile = CurrentDb.Name

Guessing, but...

Remove the
Or _
FOF_RENAMECONCO LLISION

which flag probably is what causes the "Copy (n) of " file name.

Then something to the effect of (you'll have to check for
options to make now() a string)

strSaveFile = CurrentDb.Name & now() & "_backup.md b"

possibly with a Left$(CurrentDb .Name, len(CurrentDb.N ame) - 4) if you
need to remove a pre-existing ".mdb"
--
> =============== =============== =============== =============== == <
> wl*****@ix.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG <
> wu******@dm.net | Bestiaria Support Staff <
> =============== =============== =============== =============== == <
> Home Page: <http://www.dm.net/~wulfraed/> <
> Overflow Page: <http://wlfraed.home.ne tcom.com/> <

Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
7211
by: jenny | last post by:
Hi, I am trying to find a VB way that would create a folder on all existing drives - the folder name would be the same on each drive. ie c:\backup, d:\backup, etc. But the folders would only be created if they don't already exist, and if the drive happens to be one a folder cannot be created on (ie a cdrom drive) it would just be skipped without the code generating any errors. your help on this would be most appreciated. jenny
2
13393
by: nt | last post by:
I am having a problem with a regular backup of an SQL Server (MSDE 2000) database to a local drive. I initiate the backup once a week, by issuing the required T-SQL, via ADO. In this case, the T-SQL is: BACKUP DATABASE GPRS_Dimensioning_Archive TO local_backup WITH RETAINDAYS=21, NAME='GDA_20040706' Note that "local_backup" is a file sitting on the same physical drive as the database itself, and has > 80 GB free. It is not a RAID...
236
10086
by: Andrew Rawnsley | last post by:
Anyone out there using beta 2 in production situations? Comments on stability? I am rolling out a project in the next 4 weeks, and really don't want to go though an upgrade soon after its released on an Unsuspecting Client, so I would LIKE to start working with 7.4. -------------------- Andrew Rawnsley President The Ravensfield Digital Resource Group, Ltd.
1
4755
by: alex | last post by:
Hi ! I couldn't make backups with our new system using db2 8.2. Every time I trigger a backup I get this error message: BACKUP DATABASE EBUERO2 ONLINE TO "/raid/backup/ebuero2/part1", "/raid/backup/ebuero2/part10", "/raid/backup/ebuero2/part11", "/raid/backup/ebuero2/part12", "/raid/backup/ebuero2/part13", "/raid/backup/ebuero2/part14", "/raid/backup/ebuero2/part15", "/raid/backup/ebuero2/part16", "/raid/backup/ebuero2/part17",
2
2228
by: db2group88 | last post by:
we are using db2 udb v8.2 Express edition on windows 2003,we use third party vendor software to help replicate one server to another. Production server has three instances, each instances has one database under it. So we would see three folders on D drive: DB2 folder, TEST folder and EDU folder, each database has 5 tablespaces and they exist on F drive. So I told the client to replicate the three instance folders on D and the data folder...
3
6321
by: ChrisWinterscheid | last post by:
We are running DB2 8.1 on AIX 5.2. DB2level shows: DB21085I Instance "db2inst1" uses "32" bits and DB2 code release "SQL08016" with level identifier "02070106". Informational tokens are "DB2 v8.1.1.56", "s040616", "U497635", and FixPak "6". Product is installed at "/usr/opt/db2_08_01".
5
3240
by: HSP | last post by:
hi. i need to restore an old database. The db was backed up using a DLT drive, using 2 volumes. The content for the tapes was copied to file onto Solaris machine using rsh and dd (for backup purposes). Now, the drive is defective and can't read the tapes anymore. Server is AIX 4.3.2 and database is IBM DB2 Server (DB2 for AIX Version 2.1.2)
5
7116
by: smoi | last post by:
Hi all, My manager ask me to do backup for 3 database and restore them in a new server. I did the backup for the 3 database into BAK file. Then in the new server, when I did the restore in SQL Server Enterprise Manager by using their restore function and selecting device(s) for the BAK file, I encounter the different messages such as the following: 1. Microsoft SQL-DMO (ODBC SQLState: 4200) The media family on device 'C:\Backup.BAK' is...
8
1400
by: Tamer Ibrahim | last post by:
Hi, Can I backup & restore my sql server database from aspx page located on a client machine ? Thank You.
0
10475
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10222
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10026
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9068
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7564
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4139
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.