|
-
August 20th, 2001, 08:27 PM
#1
opening binary file
I need to open a binary file and save it to an access 4.0, but I can't figure out how to open it in a way that I can then move it into an ado recordset.
-
August 21st, 2001, 07:01 AM
#2
Re: opening binary file
Function FileText(ByVal filename As String) As String
Dim handle As Integer
' ensure that the file exists
If Len(Dir$(filename)) = 0 Then
Err.Raise 53 ' File not found
End If
' open in binary mode
handle = FreeFile
Open filename$ For Binary As #handle
' read the string and close the file
FileText = Space$(LOF(handle))
Get #handle, , FileText
Close #handle
End Function
now add this to your recordset
Iouri Boutchkine
[email protected]
-
August 22nd, 2001, 05:57 AM
#3
Re: opening binary file
Thanks, that worked and showed me that I didn't know how to save a binary file to an OLE field. I tried to do the way I save and transfer other fields: adorec!Picture = bFile I called your function like this: Call FileText(bFile) It might be because I need to dim bFile as a Variant, I'll try it tonight.
-
August 22nd, 2001, 07:30 AM
#4
Re: opening binary file
Rate it if it helped you
Iouri Boutchkine
[email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|