Re: access - ole object - using vb
From: Norm Cook (normcookNOSPAM_at_cableone.net)
Date: 11/23/04
- Next message: Jeff Johnson [MVP: VB]: "ask for password"
- Previous message: StephenMcC: "RE: Creaet XML file from recordset"
- In reply to: Bala: "Re: access - ole object - using vb"
- Next in thread: Bala: "Re: access - ole object - using vb"
- Reply: Bala: "Re: access - ole object - using vb"
- Reply: Bala: "Re: access - ole object - using vb"
- Reply: Bala: "Re: access - ole object - using vb"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 23 Nov 2004 08:51:23 -0600
Don't know about your file conversion problem, but here's some code to read
the entire
ole object to a byte array & save it as a file.
Dim filenum As Integer
Dim ab() As Byte
Dim db As Database
Dim rst As Recordset
Set db = opendatabase("c:\somedatabase.mdb")
Set rst = db.OpenRecordset("SomeTable")
rst.MoveLast
ReDim ab(rst("SomeOleObjectField").FieldSize)
ab() = rst("SomeOleObjectField").GetChunk(0,
rst("SomeOleObjectField").FieldSize)
rst.Close
db.Close
filenum = FreeFile
Open "c:\somepath\somefile.ext" For Binary As #filenum
Put #filenum, , ab()
Close #filenum
"Bala" <Bala@discussions.microsoft.com> wrote in message
news:E39EF915-C532-4F19-B12F-C899383F4F4A@microsoft.com...
> Hi,
>
> I tried using getchunk. but i am getting file conversion problem.
> any other idea?
>
> thanks
> bala
>
> "Norm Cook" wrote:
>
> > Read up on GetChunk
> >
> > "Bala" <Bala@discussions.microsoft.com> wrote in message
> > news:6E8792C5-5876-4A57-A9D7-C9603F29FEB4@microsoft.com...
> > > Hi
> > >
> > > In my access table one of the field data type OLE Object. and its
contain
> > > word document file. i need to save this file into local folder. idea
how
> > to
> > > do this thru vb?
> > >
> > > Thanks
> > > Bala
> >
> >
> >
- Next message: Jeff Johnson [MVP: VB]: "ask for password"
- Previous message: StephenMcC: "RE: Creaet XML file from recordset"
- In reply to: Bala: "Re: access - ole object - using vb"
- Next in thread: Bala: "Re: access - ole object - using vb"
- Reply: Bala: "Re: access - ole object - using vb"
- Reply: Bala: "Re: access - ole object - using vb"
- Reply: Bala: "Re: access - ole object - using vb"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|