Did you set the reference to the "Microsoft Scripting Runtime" as I mentioned?gabo said:I try to use this code, but when I call the function trough a click button a received and error with the file system object I use access 2003 could youi please help me....
thank you very much
I have never seen a sucessfull posted with code to allow Access to write directly to a CD burner. I suggest that you get a mini USB thumbnail drive. One sale with a rebate you can get a 64 megabyte thumbnail drive for less than fifteen dollars at any office supply store. I carry one with me daily.Oldsoftboss said:This is great stuff, and I will attempt to add it to by Db's. As mentioned a Db will soon grow to greater then the 1.4 mb. How much would be involved to alter the code to back up to a CD burner ?
Dave
Old DOS naming conventions comes back to haunt you. Try this...Oldsoftboss said:If I may...
One problem I have is when I try to enter a save path with spaces ie:
sBackupPath = "C:\My Documents"
sBackupFile = "Back Up" & Format(Date, "dd-mm-yyyy") & ".mdb"
generate errors.
I hope to sort this out so I can use the BrowseForFolder dialog box to select a save path.
Dave
Here is some code I have not used in quite a while...Oldsoftboss said:One other thing I woud like to do is, when selecting the file to backup, cut the path and use just the file name as the base name for the backup.
Private Function ParseFileName()
On Error GoTo ParseFileName_Err
Dim sFullName As String
Dim sFilePathOnly As String
Dim sDrive As String
Dim sPath As String
Dim sLocation As String
Dim sFilename As String
sFullName = tbExportImportName.Value
' Find the final "\" in the path.
sPath = sFullName
Do While Right$(sPath, 1) <> "\"
sPath = Left$(sPath, Len(sPath) - 1)
Loop
' Find the Drive.
sDrive = Left$(sFullName, InStr(sFullName, ":") + 1)
'tbDrive = sDrive
' Find the Location.
sLocation = Mid$(sPath, Len(sDrive) - 2)
'tbLocation = sLocation
' Find the Path.
sPath = Mid$(sPath, Len(sDrive) + 1)
'tbPath = sPath
' Find the file name.
sFilename = Mid$(sFullName, Len(sPath) + 4)
tbFileName = sFilename
ParseFileName_Exit:
Exit Function
ParseFileName_Err:
Msgbox Err.Number & " - " & Err.Description
Resume ParseFileName_Exit
End Function
Yes, that is correct.Oldsoftboss said:I presume it is the string of the full path??