Windows XP SP3
Access 2007 Office SP1
I used code below to attach over 600 wav files of contemporaneous case progress dictation to records in my violence interruption database
Worked great for quite a while, except for occasional "Unable to Open" an attachment file, which a reboot would get things back on track.
Frequency of the unable to open increased over time, every once and a while I'd get one saying Windows media player (11) didn't have the correct codec, but still a reboot would fix.
Now the message comes up all the time and I can't summarize my field dictation responding to shootings, stabbings, etc.... so I can't bill for my consulting time without using other methods. Since I have other workers on the street this gets cumbersome.
Updating to XP SP3, no dice
Applying SP1 to the Office Suite
Rolling back Windows media player from 11 to 10 in case that was the problem
Compacting and repairing...
To simplify troubleshooting I created a very simple new Access 2007 database with just one table and a record with an attachment field. Tried attaching Word, PDF and other types of files besides .wav, using the Manage Attachments dialog box, not VB code. Same error message all the time.
Oh, also uninstalled my AVG free 8.5 virus checker, as some checkers are touchy about opening attachments.... no dice either.
I can use the Manage Attachments dialog to save an attachment back to a folder and it plays there. I also noticed earlier in my troublshooting that sometimes when I did this the saved file was of zero length, but deleting the attachment field, re creating it and rerunning the code put the attachments back into the database for use, for a while, then they wouldn't open again, without reboot, then eventually not at all.
I tried putting some Locatelli Pecorino Romano grating cheese in a bag and swinging it around my head screaming like a cross between a chicken and Marlon Mumbles Brando in the Godfather but this only forced the squirrels living in my attic to meet to discuss if it was a safe to raise their children there anymore.
Private Sub Command14_Click()
'select the currently open database
Set dbCurr = CurrentDb
'confirm it is the correct one
'create a pointer to the recordings recordset
Dim rsRecordingz As Recordset
'open Recordingz recordset
Set rsRecordingz = dbCurr.OpenRecordset("Imported Recordings")
'loop through records and attach recordings
Do Until rsRecordingz.EOF
Debug.Print rsRecordingz!WaveFileName & " "; rsRecordingz!TimeStamp
'prepare parent record for operations
'instantiate child recordset
Set rsRecord = rsRecordingz.Fields("Recording").Value
'Add a new recording object
'attach the .wav file in the folder to the record
rsRecord.Fields("FileData").LoadFromFile "C:\Documents and Settings\Default\Desktop\YVIRC Recordings\" & rsRecordingz!WaveFileName
'update child record
'update the parent record
'move to next parent record