473,427 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,427 software developers and data experts.

save MDB file through forms?

Hi All,

I know this might be a silly question to ask but i was just wondering,
is there a way to save a specific MDB file , which is accessed from the server,
in to the local machine in a specific folder.

It will be good if there is a way so that the user can create a backup of the database they use into the local machine before they close.

is there any way or any other similar operation that could do this task???!!!!

thanks and regards,
catherine
Aug 30 '07 #1
9 2452
JConsulting
603 Expert 512MB
Hi All,

I know this might be a silly question to ask but i was just wondering,
is there a way to save a specific MDB file , which is accessed from the server,
in to the local machine in a specific folder.

It will be good if there is a way so that the user can create a backup of the database they use into the local machine before they close.

is there any way or any other similar operation that could do this task???!!!!

thanks and regards,
catherine
Hi Catherine,
There are always ways....but as in all things, there's a why involved here. Chances are if your database is on a server, it's already being backed up. As developers, we put our databases in central locations so the users don't end up creating their own that we'd eventually have to merge back into the original. I think my peers here back me up when I say it's a bad idea. If your user has a requirement to have a backup, then perhaps it's a more pointed request than backing up the whole database. Check with the administrators of the server to see if backups are being done already.

If you still feel you should complete this request, then you must make sure that the user has permissions to get to the database location, and it's a simple copy after that. It's a very bad idea to copy an open database, so this action should take place outside of the database that you want to copy. That also means that no one else should be in it either.

Maybe you should consider a batch file that you can run that copies the database. This type of file can be programmed into a scheduler and run at regular intervals.

There's a lot to your request...so if you require specific help on any of this, please let us know.
J
Aug 31 '07 #2
Hi Catherine,
There are always ways....but as in all things, there's a why involved here. Chances are if your database is on a server, it's already being backed up. As developers, we put our databases in central locations so the users don't end up creating their own that we'd eventually have to merge back into the original. I think my peers here back me up when I say it's a bad idea. If your user has a requirement to have a backup, then perhaps it's a more pointed request than backing up the whole database. Check with the administrators of the server to see if backups are being done already.

If you still feel you should complete this request, then you must make sure that the user has permissions to get to the database location, and it's a simple copy after that. It's a very bad idea to copy an open database, so this action should take place outside of the database that you want to copy. That also means that no one else should be in it either.

Maybe you should consider a batch file that you can run that copies the database. This type of file can be programmed into a scheduler and run at regular intervals.

There's a lot to your request...so if you require specific help on any of this, please let us know.
J
Hi J,

Thanks for your reply. I spoke to my Admin and i came to know they have not set up the server to have backups but he will do it some time soon. (strange..i dunno when!!)

but as of now what i am doing is, before leaving the office every night, i am keeping a copy of the db in my local machine.

I hope if the server is scheduled for backups, then i dont have to do this. I am just curious to know is there anyway to do this operation by any means, if the user has full access permission over the db??!!

regards,
Catherine
Aug 31 '07 #3
JConsulting
603 Expert 512MB
Hi J,

Thanks for your reply. I spoke to my Admin and i came to know they have not set up the server to have backups but he will do it some time soon. (strange..i dunno when!!)

but as of now what i am doing is, before leaving the office every night, i am keeping a copy of the db in my local machine.

I hope if the server is scheduled for backups, then i dont have to do this. I am just curious to know is there anyway to do this operation by any means, if the user has full access permission over the db??!!

regards,
Catherine
Is the old click and drag option not available to you? Are you looking for some kind of script or copy command thinking that you can push a button and be done?

Like I said, if you're in the database that you want to backup, then you'll end up with corruption.
J
Aug 31 '07 #4
May be ontherun should use scheduling software to save the mdb file in the respective folder.
Sep 2 '07 #5
JConsulting
603 Expert 512MB
May be ontherun should use scheduling software to save the mdb file in the respective folder.

Expand|Select|Wrap|Line Numbers
  1. If you feel you're all right with saving when you close still, create a small function
  2.  
  3. Put it into a CODE module.
  4.  
  5. Function SaveBackEnd()
  6. Dim strSavePath, strSaveFile, strNowPath as string
  7. strSavePath = "C:\Database\"   ' the directory where you want to save your back end
  8. strNowPath = "C;\Wherever\MyBackend.mdb" ' the directory where your back end is now
  9. strSaveFile = "MyBackend_" & format(date(),"mmddyyyy") & ".mdb"
  10. filecopy strNowPath, strSavePath & strSaveFile
  11. end function
  12.  
  13. Now in your on_close event of your switchboard, call the function
  14.  
  15. SaveBackEnd
  16.  
  17.  
Sep 3 '07 #6
Expand|Select|Wrap|Line Numbers
  1. If you feel you're all right with saving when you close still, create a small function
  2.  
  3. Put it into a CODE module.
  4.  
  5. Function SaveBackEnd()
  6. Dim strSavePath, strSaveFile, strNowPath as string
  7. strSavePath = "C:\Database\"   ' the directory where you want to save your back end
  8. strNowPath = "C;\Wherever\MyBackend.mdb" ' the directory where your back end is now
  9. strSaveFile = "MyBackend_" & format(date(),"mmddyyyy") & ".mdb"
  10. filecopy strNowPath, strSavePath & strSaveFile
  11. end function
  12.  
  13. Now in your on_close event of your switchboard, call the function
  14.  
  15. SaveBackEnd
  16.  
  17.  
I must try this out as well.
Sep 3 '07 #7
I must try this out as well.
Hi ,
i saved the as in the module and called from on_Close event..
but it doesnt do anything i mean, there is no mdb file saved in the directory i specified nor a error message.

the code was,

Privare Sub Form_Close()

SaveBackEnd - module

End Sub


MODULE:

Function SaveBackEnd()

Dim strSavePath, strSaveFile, strNowPath As String

strSavePath = "C:\TestingDB\"

strNowPath = "C:\Documents and Settings\Admin\Desktop\PriceList.mdb"

strSaveFile = "MyBackend_" & Format(Date, "mmddyyyy") & ".mdb"

FileCopy strNowPath, strSavePath & strSaveFile

End Function

Instead, i used this code on button click: but i got a error message saying, Expected Variable or procedure not a module.

need your assistance

regards,
catherine
Sep 4 '07 #8
JConsulting
603 Expert 512MB
Hi ,
i saved the as in the module and called from on_Close event..
but it doesnt do anything i mean, there is no mdb file saved in the directory i specified nor a error message.

the code was,

Privare Sub Form_Close()

SaveBackEnd - module

End Sub


MODULE:

Function SaveBackEnd()

Dim strSavePath, strSaveFile, strNowPath As String

strSavePath = "C:\TestingDB\"

strNowPath = "C:\Documents and Settings\Admin\Desktop\PriceList.mdb"

strSaveFile = "MyBackend_" & Format(Date, "mmddyyyy") & ".mdb"

FileCopy strNowPath, strSavePath & strSaveFile

End Function

Instead, i used this code on button click: but i got a error message saying, Expected Variable or procedure not a module.

need your assistance

regards,
catherine

is this verbatim?

Expand|Select|Wrap|Line Numbers
  1. Privare Sub Form_Close()
  2.  
  3. SaveBackEnd - module
  4.  
  5. End Sub
  6.  
take out the - module

so its just SaveBackEnd

you inserted the code into a new module right? You didn't save the module SaveBackEnd by chance did you? if you did, you can't name a module and function the same..rename your module to mod_SaveBackEnd

J
Sep 4 '07 #9
is this verbatim?

Expand|Select|Wrap|Line Numbers
  1. Privare Sub Form_Close()
  2.  
  3. SaveBackEnd - module
  4.  
  5. End Sub
  6.  
take out the - module

so its just SaveBackEnd

you inserted the code into a new module right? You didn't save the module SaveBackEnd by chance did you? if you did, you can't name a module and function the same..rename your module to mod_SaveBackEnd

J
I didnt include the word module in the code. however i saved the module as mod_SaveBackEnd and called the function under Form_Close() function.
but when i tried to close , it says permission denied.

then i tried 2 call the function under Quit Button Click.
but nothing happens and the my file was not saved in the folder i specified.

is there any other step am missing here???
need your assistance.

regards,
Catherine
Sep 4 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Andras Gilicz | last post by:
Hi VB fans I'm working on a relatively large project in VB6 with about a dozen forms, including graphs, labels, text boxes, etc. The software itself is actually a flow simulator with more or...
4
by: deko | last post by:
I'm trying to set up a "preferences form" where users can choose from a few different pre-defined colors. The color numbers and form names are saved in tblColors. The below code changes the form...
2
by: icedgar | last post by:
am using the following script in the BeforeUpdate area of a main form. Private Sub Form_BeforeUpdate(Cancel As Integer) Dim strMsg As String strMsg = "Do you wish to save your changes?" If...
2
by: deko | last post by:
I create an XmlDataDocument Dataset when the main form of my WinForms app opens. The user will make changes to the Dataset, and then those changes should be saved to the XML file when the code...
1
by: DSchlichte | last post by:
Hello ' I need some help. I've created a little application to paint, save and load pictures (Bitmap-graphics) into ' a picturebox-object on the desktop. There's no problem to paint or to load...
2
by: Marcos | last post by:
Hi Everybody!! Does anyone know how I can save all Access form (with a database) on a CD, for example? I save the file, but there's only the empty form, without other archives. I'd like to know...
0
by: zulbaric | last post by:
Hi, ive just finished building more "tabbed web browser with favourites menu" but i cant ge the favourites menu to work properly. THe add functions are ok the problem is I cant ge t the favourites to...
12
by: Lee | last post by:
I have the following code using System; using System.Windows.Forms; using System.Drawing; using System.Collections; namespace FINN {
6
by: Josetta | last post by:
Access 2003 I've been experiencing some problems with my "monster" database the last couple of days. I imported all objects into a new database yesterday, which pretty much stopped the crashing...
0
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?= | last post by:
Hi, thanks, mister The code string rutaConfig = tbRutaConfigServicioBase.Text; '// Map to the application configuration file. ExeConfigurationFileMap configFile = New...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
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,...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.