dbTalk Databases Forums  

Write To CD

comp.databases.ms-access comp.databases.ms-access


Discuss Write To CD in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
zuckermanf@gmail.com
 
Posts: n/a

Default Write To CD - 06-22-2009 , 07:46 AM






Hello all,
I'm trying to copy some files to a CD from within my application. I'm
using Win XP and A2000. I've learned that it is a two-step process.
First step is to copy the files to the "staging area" located at:

%userprofile%\local settings\application data\microsoft\CD Burning\

The second step is the actual burning. It should be easy enough. I can
complete this step manually (outside of my application) in a few ways:

1. My Computer -> Drive D -> Right-Click -> Write These Files.
2. Just inserting a new CD, will usually pop-up a balloon on the task
bar prompting to write the files.
3. Ejecting the CD will usually prompt a reminder to write the files.

Does anyone know a way I can write the files from within my
apllication? If it can be done with a single click outside my
application, I should be able to execute the task from within my
application....

Thanks,
Fred
PS - I am NOT trying copy my open mdb file

Reply With Quote
  #2  
Old   
Phil Stanton
 
Posts: n/a

Default Re: Write To CD - 06-22-2009 , 10:09 AM






Think this is the guts of it

CDBackup:
Set fs = CreateObject("Scripting.FileSystemObject")
If CDBackupPath = "" Then
MsgBox "There is no path set for the CD backup", vbCritical,
"Insufficient Detail"
Exit Function
End If
If Dir(DataPath) <> "" Then ' Make sure that the
data file exists
If Dir(CDBackupPath) = "" Then ' CD File not found
Msg = "Can't find the " & CDBackupPath & " File on the CD" &
Chr$(13)
Msg = Msg & " Do you want to create this file yourself?"
If MsgBox(Msg, vbQuestion + vbYesNo, "Missing CD File") = vbNo
Then
Exit Function
Else
BackupFolder = Left$(CDBackupPath, (InStrRev(CDBackupPath,
"\") - 1))
fs.createfolder (BackupFolder)
End If
End If
fs.Copyfile DataPath, CDBackupPath, True ' Copy Data to AMM
Services Data.Bak
GoTo UpdateBackupTable
Else
MsgBox "Can't find the " & DataPath & " File", vbCritical
Exit Function
End If

DataPath is the file name of the BE Database and CDBackupPath is the file
name of the file on the CD

HTH

Phil
<zuckermanf (AT) gmail (DOT) com> wrote

Quote:
Hello all,
I'm trying to copy some files to a CD from within my application. I'm
using Win XP and A2000. I've learned that it is a two-step process.
First step is to copy the files to the "staging area" located at:

%userprofile%\local settings\application data\microsoft\CD Burning\

The second step is the actual burning. It should be easy enough. I can
complete this step manually (outside of my application) in a few ways:

1. My Computer -> Drive D -> Right-Click -> Write These Files.
2. Just inserting a new CD, will usually pop-up a balloon on the task
bar prompting to write the files.
3. Ejecting the CD will usually prompt a reminder to write the files.

Does anyone know a way I can write the files from within my
apllication? If it can be done with a single click outside my
application, I should be able to execute the task from within my
application....

Thanks,
Fred
PS - I am NOT trying copy my open mdb file

Reply With Quote
  #3  
Old   
zuckermanf@gmail.com
 
Posts: n/a

Default Re: Write To CD - 06-22-2009 , 01:54 PM



Thank you, Phil.
I'ved tried using the FileCopy method, but it didn't work.
My CD drive is D:
My hard disk is C:
Here's my code:

Dim fs As Object
Set fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFile "C:\Photos\2a.jpg", "D:\"
Set fs = Nothing

The msg received is Error 76, Path Not Found
If I replace D:\ with C:\ it copies the file correctly to the root of
my hard disk.

Fred



On Jun 22, 8:09*am, "Phil Stanton" <p... (AT) myfamilyname (DOT) co.uk> wrote:
Quote:
Think this is the guts of it

CDBackup:
* * Set fs = CreateObject("Scripting.FileSystemObject")
* * If CDBackupPath = "" Then
* * * * MsgBox "There is no path set for the CD backup", vbCritical,
"Insufficient Detail"
* * * * Exit Function
* * End If
* * If Dir(DataPath) <> "" Then * * * * * * * * * * ' Make sure that the
data file exists
* * * * If Dir(CDBackupPath) = "" Then * * * * * * *' CD File not found
* * * * * * Msg = "Can't find the " & CDBackupPath & " Fileon the CD" &
Chr$(13)
* * * * * * Msg = Msg & " Do you want to create this file yourself?"
* * * * * * If MsgBox(Msg, vbQuestion + vbYesNo, "Missing CD File") = vbNo
Then
* * * * * * * * Exit Function
* * * * * * Else
* * * * * * * * BackupFolder = Left$(CDBackupPath, (InStrRev(CDBackupPath,
"\") - 1))
* * * * * * * * fs.createfolder (BackupFolder)
* * * * * * End If
* * * * End If
* * * * fs.Copyfile DataPath, CDBackupPath, True * *' Copy Data to AMM
Services Data.Bak
* * * * GoTo UpdateBackupTable
* * Else
* * * * MsgBox "Can't find the " & DataPath & " File", vbCritical
* * * * Exit Function
* * End If

DataPath is the file name of the BE Database and CDBackupPath is the file
name of the file on the CD

HTH

Phil<zuckerm... (AT) gmail (DOT) com> wrote in message

news:13280bd7-c3cd-46fc-89ca-daa70ada1297 (AT) v35g2000pro (DOT) googlegroups.com...



Hello all,
I'm trying to copy some files to a CD from within my application. I'm
using Win XP and A2000. I've learned that it is a two-step process.
First step is to copy the files to the "staging area" located at:

%userprofile%\local settings\application data\microsoft\CD Burning\

The second step is the actual burning. It should be easy enough. I can
complete this step manually (outside of my application) in a few ways:

1. My Computer -> Drive D -> Right-Click -> Write These Files.
2. Just inserting a new CD, will usually pop-up a balloon on the task
bar prompting to write the files.
3. Ejecting the CD will usually prompt a reminder to write the files.

Does anyone know a way I can write the files from within my
apllication? If it can be done with a single click outside my
application, I should be able to execute the task from within my
application....

Thanks,
Fred
PS - I am NOT trying copy my open mdb file- Hide quoted text -

- Show quoted text -

Reply With Quote
  #4  
Old   
Phil Stanton
 
Posts: n/a

Default Re: Write To CD - 06-22-2009 , 04:29 PM



As far as I remember, the copy to needs to be a file name rather than a
directory, hence the various checks that things exist, so try

fs.CopyFile "C:\Photos\2a.jpg", "D:\Photos\2a.jpg"

Phil

<zuckermanf (AT) gmail (DOT) com> wrote

Thank you, Phil.
I'ved tried using the FileCopy method, but it didn't work.
My CD drive is D:
My hard disk is C:
Here's my code:

Dim fs As Object
Set fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFile "C:\Photos\2a.jpg", "D:\"
Set fs = Nothing

The msg received is Error 76, Path Not Found
If I replace D:\ with C:\ it copies the file correctly to the root of
my hard disk.

Fred



On Jun 22, 8:09 am, "Phil Stanton" <p... (AT) myfamilyname (DOT) co.uk> wrote:
Quote:
Think this is the guts of it

CDBackup:
Set fs = CreateObject("Scripting.FileSystemObject")
If CDBackupPath = "" Then
MsgBox "There is no path set for the CD backup", vbCritical,
"Insufficient Detail"
Exit Function
End If
If Dir(DataPath) <> "" Then ' Make sure that the
data file exists
If Dir(CDBackupPath) = "" Then ' CD File not found
Msg = "Can't find the " & CDBackupPath & " File on the CD" &
Chr$(13)
Msg = Msg & " Do you want to create this file yourself?"
If MsgBox(Msg, vbQuestion + vbYesNo, "Missing CD File") = vbNo
Then
Exit Function
Else
BackupFolder = Left$(CDBackupPath, (InStrRev(CDBackupPath,
"\") - 1))
fs.createfolder (BackupFolder)
End If
End If
fs.Copyfile DataPath, CDBackupPath, True ' Copy Data to AMM
Services Data.Bak
GoTo UpdateBackupTable
Else
MsgBox "Can't find the " & DataPath & " File", vbCritical
Exit Function
End If

DataPath is the file name of the BE Database and CDBackupPath is the file
name of the file on the CD

HTH

Phil<zuckerm... (AT) gmail (DOT) com> wrote in message

news:13280bd7-c3cd-46fc-89ca-daa70ada1297 (AT) v35g2000pro (DOT) googlegroups.com...



Hello all,
I'm trying to copy some files to a CD from within my application. I'm
using Win XP and A2000. I've learned that it is a two-step process.
First step is to copy the files to the "staging area" located at:

%userprofile%\local settings\application data\microsoft\CD Burning\

The second step is the actual burning. It should be easy enough. I can
complete this step manually (outside of my application) in a few ways:

1. My Computer -> Drive D -> Right-Click -> Write These Files.
2. Just inserting a new CD, will usually pop-up a balloon on the task
bar prompting to write the files.
3. Ejecting the CD will usually prompt a reminder to write the files.

Does anyone know a way I can write the files from within my
apllication? If it can be done with a single click outside my
application, I should be able to execute the task from within my
application....

Thanks,
Fred
PS - I am NOT trying copy my open mdb file- Hide quoted text -

- Show quoted text -

Reply With Quote
  #5  
Old   
zuckermanf@gmail.com
 
Posts: n/a

Default Re: Write To CD - 06-22-2009 , 09:25 PM



Thanks again, Phil.
The documentation says wild cards are allowed.
And the code works with the destination of "C:\".
But I tried your suggestion as follows (this code is behind a button):

Dim fs As Object
Set fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFile "C:\Photos\2a.jpg", "D:\2a.jpg"
Set fs = Nothing

I get the following error:

error = -2147024895 (80070001)
Method 'CopyFile' of object 'IFileSystem3' failed

Fred




On Jun 22, 2:29*pm, "Phil Stanton" <p... (AT) myfamilyname (DOT) co.uk> wrote:
Quote:
As far as I remember, the copy to needs to be a file name rather than a
directory, hence the various checks that things exist, so try

fs.CopyFile "C:\Photos\2a.jpg", "D:\Photos\2a.jpg"

Phil

Reply With Quote
  #6  
Old   
Phil Stanton
 
Posts: n/a

Default Re: Write To CD - 06-23-2009 , 04:00 AM



Hi Fred

This workks OK on my machine


Function Test()

Dim fs As Object
Set fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFile "C:\Documents and Settings\Phil\My Documents\My Pictures\Barge
trip 2005 019.jpg", "C:\Documents and Settings\Phil\My Documents\My
Pictures\TestBarge.jpg"
Set fs = Nothing

End Function

So first test if you can copy your file to somewhere else on the C Drive.
Bet you can. So that will leave the problem as the copyind software to your
D Drive. There used to be a program called InCD which made the CD reacts in
the same way as a floppy drive (are you old enough to remember them)

Judging by the bits in your original posing, that is where the problem lies.

Phil
<zuckermanf (AT) gmail (DOT) com> wrote

Thanks again, Phil.
The documentation says wild cards are allowed.
And the code works with the destination of "C:\".
But I tried your suggestion as follows (this code is behind a button):

Dim fs As Object
Set fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFile "C:\Photos\2a.jpg", "D:\2a.jpg"
Set fs = Nothing

I get the following error:

error = -2147024895 (80070001)
Method 'CopyFile' of object 'IFileSystem3' failed

Fred




On Jun 22, 2:29 pm, "Phil Stanton" <p... (AT) myfamilyname (DOT) co.uk> wrote:
Quote:
As far as I remember, the copy to needs to be a file name rather than a
directory, hence the various checks that things exist, so try

fs.CopyFile "C:\Photos\2a.jpg", "D:\Photos\2a.jpg"

Phil

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.