ive managed to piece together this code that creates a backup folder and then copies the (Access 2000) database into it under the new name "Backup YYYY-MMM-DD HH.MM".
It worked fine in the database I created to practise and create the code, but when i copy and paste it to the main database none of it works, and i have no idea why.
I know the code is probably pretty messy, but i only started to learn VB a little over a year ago, so all help is much appreciated: - Private Sub cmdBackup_Click()
-
'Create the new folder "Backup" to store database backups
-
Dim objNet, objFSO, objFolder, strDirectory, test
-
-
On Error Resume Next
-
-
Set objNet = CreateObject("WScript.NetWork")
-
-
Set objNet = CreateObject("WScript.NetWork")
-
If Err.Number <> 0 Then 'If error occured then display notice
-
MsgBox "Don't be Shy." & vbCrLf & "Do not press ""No"" If your browser warns you."
-
Document.Location = "UserInfo.html"
-
'Place the Name of the document.
-
'It will display again
-
End If
-
-
Dim strInfo
-
-
strInfo = objNet.UserName
-
strDirectory = CurrentProject.Path & "\Backup"
-
-
Set objFSO = CreateObject("Scripting.FileSystemObject")
-
Set objFolder = objFSO.CreateFolder(strDirectory)
-
Set objNet = Nothing 'Destroy the Object to free the Memory
-
'End of make folder
-
-
'*****************************************
-
-
'Make a backup of the database into the newly created folder
-
On Error GoTo Back_Database
-
Dim fso, fs, Src, Dst As String
-
-
Src = CurrentDb.Name
-
-
Dst = CurrentProject.Path & "\Backup\Backup " & Format(Now, "yyyy-mmm-dd hh.mm") & ".mdb"
-
-
Set fso = CreateObject("Scripting.FileSystemObject")
-
Set fs = fso.GetFolder(CurrentProject.Path & "\Backup")
-
C_Backup:
-
fso.CopyFile Src, Dst
-
MsgBox "Backup Complete", vbInformation
-
Exit Sub
-
-
Back_Database: If Err.Number = 76 Then
-
MkDir CurrentProject.Path & "\Backup"
-
GoTo C_Backup
-
ElseIf Err.Number = 53 Then
-
fso.CopyFile Src, Dst
-
MsgBox "Backup Complete", vbInformation, "Backup Complete"
-
Else
-
MsgBox Err.Description
-
End If
-
End Sub
Like i said all help is much appreciated
NDayave
Feb 12 '07
18 2877
I unchecked the extra references on the actual database: Microsoft Office XP Web Components
wiaview 1.0 Type Library
and it worked fine, thanks a lot.
Will having these two references unchecked have any negative consequences on the database though?
Thanks again,
NDayave
NeoPa 32,579
Recognized Expert Moderator MVP
This may sound like a lame answer, but "Only if your database is using anything provided by these libraries."
There shouldn't be anything standard affected by losing these two though I don't think.
maxamis4 295
Recognized Expert Contributor
It can be, what references do is import built in functions that allow Access to communicate to other devices. I would match them up identically and see what results you get.
With regard to the references, what determines which are selected and which aren't? Would there be any reason for the extra references to be checked in the actual database, or is it just a default setting?
MMcCarthy 14,534
Recognized Expert Moderator MVP
With regard to the references, what determines which are selected and which aren't? Would there be any reason for the extra references to be checked in the actual database, or is it just a default setting?
It's not a default setting only the first four are. The others are checked so that they can be used by the designer. Run the compiler and see if any errors pop up since you removed these references.
Mary
I went into the code window => Debug => Compile Booking System
im guessing thats what you meant, there was a loading bar visible very briefly on the toolbar and then nothing else happened and now i cant compile again. Would i be right in thinking this means there are no problems?
MMcCarthy 14,534
Recognized Expert Moderator MVP
I went into the code window => Debug => Compile Booking System
im guessing thats what you meant, there was a loading bar visible very briefly on the toolbar and then nothing else happened and now i cant compile again. Would i be right in thinking this means there are no problems?
That would be my interpretation.
As a test, type could something and then delete it, the compiler should reset.
Mary
That would be my interpretation.
As a test, type could something and then delete it, the compiler should reset.
Mary
Yeah it reset the compiler and again nothing but a glimpse of the loading bar and not being able to compile till something is changed again.
Thanks for that, appreciated
NDayave
NeoPa 32,579
Recognized Expert Moderator MVP
I went into the code window => Debug => Compile Booking System
im guessing thats what you meant, there was a loading bar visible very briefly on the toolbar and then nothing else happened and now i cant compile again. Would i be right in thinking this means there are no problems?
You certainly would be.
The compiler is only available when there is changed code to compile. If any (compiler level) problems are detected they will be reported and the compile will fail.
NB. Some problems cannot be detected by the compiler so it's not proof of perfect code - it's a very good check to do first though.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: *no spam* |
last post by:
I want to move my Access 2K database into MSDE. The Access Upsizing
Wizard crashes (a known bug wi A2K), so I'm using the following
suggested method:
Access --> New --> Project (Existing Database)
This asks for the name of the .adp file to create and then launches
into the Data Link Properties dialog box (so far so good) I select my
MSDE server from the drop-down, enter the sa account & passwd, attach
a database file and try to...
|
by: Sean C. |
last post by:
Helpful folks,
Most of my previous experience with DB2 was on s390 mainframe systems
and the optimizer on this platform always seemed very predictable and
consistent. Since moving to a WinNT/UDB 7.2 environment, the choices
the optimizer makes often seem flaky. But this last example really
floored me. I was hoping someone could explain why I get worse
response time when the optimizer uses two indexes, than when it uses
one. Some context:
|
by: cory |
last post by:
Hi,
I have an Access database and am having an ASP.NEt application written for
it. It is almost complete. I have a hosting company that I signed up with
a month ago but before I did anything I asked them if Access and ASP.NET
would work on their servers, they said yes so I bought in. Now they are
saying my application wont work on their servers using MSaccess and I can
only use SQL or asp 3.0. They are saying Microsoft is trying to...
|
by: Wayne Smith |
last post by:
I've come up against a major headache that I can't seem to find a solution
for but I'm sure there must be a workaround and I would really be grateful
of any help.
I'm currently building a web site for a small club I belong to and one of
the features I would like to include is the ability to allow users to upload
image files.
unfortunately the servers web root www folder only allows READ and EXECUTE
permissions, which makes it...
|
by: rcnews |
last post by:
Hi,
First timer here.
Where's the best place to educate myself on how to use PHP in
conjunction with Microsoft Access--good online tutorials, sites, blogs,
etc...? I work at a small online grocery service that would like to
develop interfacing between our databases with the web to allow
customers/users to directly manipulate profile data and make orders
that will filter directly into our database without manual entry.
| |
by: Mathieu Cartoixa |
last post by:
Hi,
I have a simple 2-tiers (client+database) application with simple
Domain Model objects The Data Access Layer is abstracted via Data
Mappers which use Data Transfer Objects to communicate with the Domain
Model objects. My Domain Model objects are declared this way :
public class City /* Inheritance removed for brevity...*/
{
private string _Name;
|
by: rajaaryan44 |
last post by:
how can we transfer data from one access database to another databse . the table name is same for both the database . in one table some records are there (rs say e.g.) now another table has say rs+10 records . now i have to pass there 10 values to another table with same name . can anyone help me with this. i m usinf DAO
. i wrote some codes in dao. i created a function : AddTableField
i m writing it in module so that it can be access from...
|
by: rkausch |
last post by:
Hello everyone,
I'm writing because I'm frustrated with the implementation of C#'s
generics, and need a workaround. I come from a Java background, and
am currently writing a portion of an application that needs
implementations in both Java and C#. I have the Java side done, and
it works fantastic, and the C# side is nearly there. The problem I'm
running into has to do with the differences in implementations of
Generics between the two...
|
by: Les Desser |
last post by:
In article
<fcebdacd-2bd8-4d07-93a8-8b69d3452f3e@s50g2000hsb.googlegroups.com>, The
Frog <Mr.Frog.to.you@googlemail.comMon, 14 Apr 2008 00:45:10 writes
Not sure if I quite follow that.
1. Data encrypted by AES key
2. AES key encrypted with Asymmetric public key (?)
|
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...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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...
|
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,...
|
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |