mustangcoupe
Technical User
I downloaded this code off the web. it is part of some other code to embed files/objects into the table (images, fonts ect...)
It works fine! But when I make changes to the database on my acc 2003 machine and recompile it errors on fieldsize in this line ReDim bytBuffer(fldFieldName.FieldSize).
but in acc 2000 it works fine. any sugestions as I cant recompile my file or run it now. (Yes I do have a back up copy at home.)
--Todd
TechnicalUser pretending to be a programmer(shhh… the boss doesn’t know yet)
It works fine! But when I make changes to the database on my acc 2003 machine and recompile it errors on fieldsize in this line ReDim bytBuffer(fldFieldName.FieldSize).
but in acc 2000 it works fine. any sugestions as I cant recompile my file or run it now. (Yes I do have a back up copy at home.)
Code:
Private Sub DownloadTableToFile(ByRef fldFieldName As Field, _
ByVal strFileName As String)
Dim bytBuffer() As Byte
Dim intFileNum As Integer
On Error GoTo ErrorHandler
intFileNum = FreeFile
Open strFileName For Binary As intFileNum
ReDim bytBuffer(fldFieldName.FieldSize)
bytBuffer = fldFieldName.GetChunk(0, fldFieldName.FieldSize)
Put intFileNum, , bytBuffer()
ExitProcedure:
On Error Resume Next
Close intFileNum
ReDim bytBuffer(0)
Exit Sub
ErrorHandler:
Select Case Err.Number
Case 0
' Take action on known errors, or better yet fix them.
Resume ExitProcedure
Case Else
MsgBox "Error in Sub DownloadTableToFile: " & CStr(Err.Number) & vbNewLine & _
Err.Description
Resume ExitProcedure
End Select
End Sub
--Todd
TechnicalUser pretending to be a programmer(shhh… the boss doesn’t know yet)