473,769 Members | 5,836 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

save MDB file through forms?

55 New Member
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 2477
JConsulting
603 Recognized Expert Contributor
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
ontherun
55 New Member
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 Recognized Expert Contributor
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
kathnicole
33 New Member
May be ontherun should use scheduling software to save the mdb file in the respective folder.
Sep 2 '07 #5
JConsulting
603 Recognized Expert Contributor
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
kathnicole
33 New Member
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
ontherun
55 New Member
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:\Testing DB\"

strNowPath = "C:\Documen ts and Settings\Admin\ Desktop\PriceLi st.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 Recognized Expert Contributor
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:\Testing DB\"

strNowPath = "C:\Documen ts and Settings\Admin\ Desktop\PriceLi st.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
ontherun
55 New Member
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
25030
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 less complex technical calculations, several input variables. I would like to equipp the starting panel with the usual New, Open, Save, Save As, Close etc. menus (like in Excel, or Word, etc.) What is the best way to accomplish Save, or Save As?...
4
18761
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 backcolor no problem, but the colors go back to what they were before if I close and reopen the database. How to I save the changes? Shouldn't "DoCmd.RunCommand acCmdSave" do the trick? For Each varF In Array("frm0", "frm1", "frm2", "frm3")...
2
2252
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 MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?") = vbYes Then 'do nothing Else
2
2313
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 runs xdd.Save(xmlFile). But I get an error when I try to save the Dataset back to the XML file: "The process cannot access the file "C:\Projects.xml" because it is being used by another process." Is this because I'm in Debug mode? How do I persist...
1
1706
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 pictures, but how can I save the image? ' My load-routine is the following (if I click on the file-menu and chose File open...):
2
1515
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 step-by-step... Thanks for a while...
0
1399
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 save / load. #region Using directives using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing;
12
4042
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
4143
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 problems, but here's something weird: Whenever I copy an object (reports so far), I am able to open it and make changes, but when I try to save it (without closing), it appears to save (message box goes off), but it doesn't. Then, if I try to...
0
2623
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 ExeConfigurationFileMap();
0
9579
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10032
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8861
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
7393
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
6661
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();...
0
5293
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5433
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3948
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
3551
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.