By the filename i meant store that AS well, it just looks better.
Now retrieving data out is in my thread about Storing Any File Type In A Database
For Word Docs what i'd do is use the shell execute function
VB Code:
Option Explicit Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long Private Const SW_MAXIMIZE = 3 Private Sub cmdGet_Click() 'check for temporary file if it's found delete it temp = App.Path & "\" & txtfilename.Text 'txtfilename holds the files name If Len(Dir(temp)) > 0 Then Kill temp End If 'Open temp file file = FreeFile Open temp For Binary As #file 'Read temp file as binary into chunk 'this is the engine room ImgeSze = rs("FILE").ActualSize Do While offset < ImgeSze chunk() = rs("FILE").GetChunk(ChunkSize) Put #file, , chunk() offset = offset + ChunkSize Loop Close #file ShellExecute Me.hwnd, vbNullString, temp ,vbNullString, vbNullString, SW_MAXIMIZE 'this is to load it's path name into the text box End Sub




Reply With Quote