473,788 Members | 3,101 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Database to a:\

I have a WORK.mdb with tables linked from a FIGURES.mdb.

I would like to click a button in a form of WORK.mdb and copy the
entire FIGURES.mdb to the floppy drive a: (in code not a macro). I
tried but i can't find how it is done.

Then a second button must read the FIGURES.mdb from the a:\ and
insert the new records into the FIGURES.mdb on the hard drive.

Anyone, anywhere, anyway, anyhow TX TX
Nov 12 '05 #1
2 1757
Peter,
Check the command FileCopy. (Filecopy SourceFile, DestinationFile )
Tables are linked but IMO when there is no recordset open there is no problem copying the file.
But: Will the mdb *fit* on a floppy ?
Maybe you also need to zip the file first?

--
Hope this helps
Arno R
"Peter D" <da*********@pa ndora.be> schreef in bericht
news:2f******** *************** **@posting.goog le.com...
I have a WORK.mdb with tables linked from a FIGURES.mdb.

I would like to click a button in a form of WORK.mdb and copy the
entire FIGURES.mdb to the floppy drive a: (in code not a macro). I
tried but i can't find how it is done.

Then a second button must read the FIGURES.mdb from the a:\ and
insert the new records into the FIGURES.mdb on the hard drive.

Anyone, anywhere, anyway, anyhow TX TX

Nov 12 '05 #2
This is something I have been using lately to save to A:\. You need Winzip
installed and you need to set the source path and source file to your setup
HTH
David b


Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Public Function BackupAndZipitT oDriveA()
On Error GoTo Err_BackupAndZi pitToDriveA

'This function will allow you to copy a db that is open,
'rename the copied db and zip it up to another folder.

'You must set a reference to the 'Microsoft Scripting Runtime' for the CopyFile
piece to work!

'Thanks to Ricky Hicks for the .CopyFile code
'Thanks to G Hudson for code
Dim fso As FileSystemObjec t

Dim sSourcePath As String
Dim sSourceFile As String
Dim sBackupPath As String
Dim sBackupFile As String
Dim Timer As Integer
sSourcePath = "C:\Stock\
sSourceFile = "Db.mdb"

sBackupPath = "A:\"
If Dir("C:\Temp", vbDirectory) = "" Then MkDir ("C:\Temp")
sBackupPath = "C:\Temp\"
sBackupFile = "Backupmydataba se_" & Format(Date, "mmddyyyy") & "_" &
Format(Time, "hhmmss") & ".mdb"
Timer = 10000
Set fso = New FileSystemObjec t
fso.CopyFile sSourcePath & sSourceFile, sBackupPath & sBackupFile, True
Set fso = Nothing
Timer = 10000
Dim intreply As Integer
Dim sWinZip As String
Dim sZipFile As String
Dim sZipFileName As String
Dim sFileToZip As String

sWinZip = "C:\Program Files\WinZip\Wi nZip32.exe" 'Location of the WinZip program
sZipFileName = Left(sBackupFil e, InStr(1, sBackupFile, ".", vbTextCompare) - 1)
& ".zip"
sZipFile = sBackupPath & sZipFileName
sFileToZip = sBackupPath & sBackupFile


Call Shell(sWinZip & " -a " & sZipFile & " " & sFileToZip, vbHide)
intreply = MsgBox("Have you placed a floppy in drive A?" & vbNewLine & "This
routine may take 10 seconds to complete.", vbYesNo)
If intreply = vbYes Then
Sleep 5000

Name sZipFile As "A:\" & sZipFileName
Else
Exit Function
End If

If Dir(sBackupPath & sBackupFile) <> "" Then Kill (sBackupPath & sBackupFile)

Beep
MsgBox "Backup was successful and saved @ " & Chr(13) & Chr(13) & "A:\" &
Chr(13) & Chr(13) & "The backup file name is " & Chr(13) & Chr(13) &
sZipFileName, vbInformation, "Backup Completed"

Exit_BackupAndZ ipitToDriveA:
Exit Function

Err_BackupAndZi pitToDriveA:
If Err = 5 Then 'Invalid procedure call or argument
Beep
MsgBox "Disk is full! Can not move the zip file to the A:\ drive.
Please move the " & sZipFile & " file to a safe location.", vbCritical
If Dir(sBackupPath & sBackupFile) <> "" Then Kill (sBackupPath &
sBackupFile)
Exit Function
ElseIf Err = 53 Then 'File not found
Beep
MsgBox "Source file can not be found!" & vbNewLine & vbNewLine &
sZipFileName, vbCritical
Exit Function
ElseIf Err = 71 Then 'Disk not ready
Beep
If Dir(sZipFile) <> "" Then Kill sZipFile
If Dir(sFileToZip) <> "" Then Kill sFileToZip
MsgBox "Please insert a diskette in drive A:\ and try again!",
vbCritical
Exit Function
ElseIf Err = -2147024784 Then 'Method 'CopyFile' of object 'IFileSystem3'
faild
Beep
MsgBox "File is to large to be zipped onto the A:\ drive!" & vbNewLine &
vbNewLine & sZipFile, vbCritical
Exit Function
Else
MsgBox Err.Number & " - " & Err.Description
Resume Exit_BackupAndZ ipitToDriveA
End If

End Function
Arno R <ar************ ****@tiscali.nl > wrote in message
news:3f******** **************@ dreader2.news.t iscali.nl...
Peter,
Check the command FileCopy. (Filecopy SourceFile, DestinationFile )
Tables are linked but IMO when there is no recordset open there is no problem copying the file. But: Will the mdb *fit* on a floppy ?
Maybe you also need to zip the file first?

--
Hope this helps
Arno R
"Peter D" <da*********@pa ndora.be> schreef in bericht
news:2f******** *************** **@posting.goog le.com...
I have a WORK.mdb with tables linked from a FIGURES.mdb.

I would like to click a button in a form of WORK.mdb and copy the
entire FIGURES.mdb to the floppy drive a: (in code not a macro). I
tried but i can't find how it is done.

Then a second button must read the FIGURES.mdb from the a:\ and
insert the new records into the FIGURES.mdb on the hard drive.

Anyone, anywhere, anyway, anyhow TX TX



Nov 12 '05 #3

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

Similar topics

0
3341
by: Cherrish Vaidiyan | last post by:
sir, The following are the steps that i followed in setting up standby database on Red hat Linux 9. i am using Oracle 9i. i have followed the steps in this site : http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96653/create_ps.htm#66206 Still i give the steps i followed. Preparing the Primary Database for Standby Database Creation
6
7345
by: Marvin Libson | last post by:
Hi All: I am running DB2 UDB V7.2 with FP11. Platform is Windows 2000. I have created a java UDF and trigger. When I update my database I get the following error: SQL1224N A database agent could not be started to service a request, or was terminated as a result of a database system shutdown or a force command.
8
7899
by: Kamlesh | last post by:
Hi, How do I know the physical database path of a database. When I goto the DB2INSTANCE users's directory (/home/db2inst1), I see following folders: /db2inst1/NODE0000/SQL00001 /db2inst1/NODE0000/SQL00002 /db2inst1/NODE0000/SQL00003 /db2inst1/NODE0000/SQL00004
1
5970
by: pintur | last post by:
The message is: SQL1036C Errore di I/O durante l' accesso al database. SQLSTATE=58030 what is the proble? what for restore tables? thanks
3
2945
by: josh.kuo | last post by:
Sorry about the subject, I can't think of a better one. I recently wrote some PHP classes that I think might be of interest to this group. Since I have been reaping the benefits of reading news groups for years, I figure it's time for me to contribute a little bit back, maybe some people out there will find this useful. * Introduction This is a "how-to" style article, showing by example how to dynamically
8
4137
by: morleyc | last post by:
Hi, until recently i was quite happy to add data sources from mssql database in visual studio and drag the datasets directly onto the form this creating a directly editable form which worked well. However i have recently started a project which will require synchronization to a remote database. Also the underlying database provider may change at a later date. From what i have read it seems that a layered approach is necessary, or at...
0
3323
by: Jack | last post by:
Training Classes for Oracle10g, 9i, 8i Certification training in Oracle10g and 9i: DBA, Developer, Discoverer. training conducted at your location worldwide. Courseware licensing also available. http://a.uuload.com/Oracle-Database.htm Unlock the Value of Your IT System Confio Software's Ignite for Oracle uses wait-event analysis to improve database performance by 65% or more. Gain visibility of every Oracle wait event. Download free...
0
3297
by: Winder | last post by:
Training Classes for Oracle10g, 9i, 8i Certification training in Oracle10g and 9i: DBA, Developer, Discoverer. training conducted at your location worldwide. Courseware licensing also available. http://a.uuload.com/Oracle-Database.htm Unlock the Value of Your IT System Confio Software's Ignite for Oracle uses wait-event analysis to improve database performance by 65% or more. Gain visibility of every Oracle wait event. Download free...
0
2561
by: Laurynn | last post by:
# (ebook - pdf) - programming - mysql - php database applicati # (Ebook - Pdf)Learnkey How To Design A Database - Sql And Crystal Report # (ebook-pdf) E F Codd - Extending the Database Relational Model to Capture More Meaning (1979) # Addison Wesley - Database Design for Mere Mortals chm # Addison Wesley - Refactoring Databases Evolutionary Database Design (2006) # Apress Beginning Databases with PostgreSQL From Novice to Professional...
9
2337
by: Peter Duniho | last post by:
Is there a straightfoward API in .NET that allows for inspection of a database? That is, to look at the structure of the database, without knowing anything in advance about it? For example, retrieving a list of tables in the database. Doing a little browsing in MSDN, I see that the abstract representation of a database appears to be the DataSet class. I also see that I can use "data adapter" classes (e.g. OdbcDataAdapter) to connect a...
0
9498
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,...
0
10363
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...
0
9964
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
8993
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
7517
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
6749
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
5535
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4069
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
3670
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.