473,402 Members | 2,064 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,402 software developers and data experts.

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 1738
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*********@pandora.be> schreef in bericht
news:2f*************************@posting.google.co m...
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 BackupAndZipitToDriveA()
On Error GoTo Err_BackupAndZipitToDriveA

'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 FileSystemObject

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 = "Backupmydatabase_" & Format(Date, "mmddyyyy") & "_" &
Format(Time, "hhmmss") & ".mdb"
Timer = 10000
Set fso = New FileSystemObject
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\WinZip32.exe" 'Location of the WinZip program
sZipFileName = Left(sBackupFile, 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_BackupAndZipitToDriveA:
Exit Function

Err_BackupAndZipitToDriveA:
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_BackupAndZipitToDriveA
End If

End Function
Arno R <ar****************@tiscali.nl> wrote in message
news:3f**********************@dreader2.news.tiscal i.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*********@pandora.be> schreef in bericht
news:2f*************************@posting.google.co m...
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
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 : ...
6
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...
8
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...
1
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
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...
8
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....
0
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....
0
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....
0
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...
9
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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...
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...

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.