Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

access - ole object - using vb
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

Report this thread to moderator Post Follow-up to this message
Old Post
Bala
11-20-04 01:55 AM


Re: access - ole object - using vb
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



Report this thread to moderator Post Follow-up to this message
Old Post
Norm Cook
11-20-04 08:55 PM


Re: access - ole object - using vb
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... 
> to 
>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
Bala
11-22-04 08:55 PM


Re: access - ole object - using vb
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:
> 
contain 
how 



Report this thread to moderator Post Follow-up to this message
Old Post
Norm Cook
11-23-04 08:55 PM


Re: access - ole object - using vb
Hi Norm Cook,

Thanks for the reply.

i am using access 2000. so when i try to use your code its giving me a error
like
Runtime error 3343

Unrecognzied database format. any other idea to solve this problem. i didnt
get answer from anyone in all the forums.

thanks
bala


"Norm Cook" wrote:

> Don't know about your file conversion problem, but here's some code to rea
d
> 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... 
> contain 
> how 
>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
Bala
11-24-04 01:55 AM


Re: access - ole object - using vb
and i change the code to ADO. i can save the file but still its giving me
file conversion problem like.

text encoding
windows(default) or MSDOS or other encoding.

thanks
bala

"Norm Cook" wrote:

> Don't know about your file conversion problem, but here's some code to rea
d
> 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... 
> contain 
> how 
>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
Bala
11-24-04 01:55 AM


Re: access - ole object - using vb
For your inforamtion how they inserting document into access ole object fiel
d.

they simply open the table and right click the column and using inser object
menu they inserting the document.

Thanks
bala

"Norm Cook" wrote:

> Don't know about your file conversion problem, but here's some code to rea
d
> 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... 
> contain 
> how 
>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
Bala
11-24-04 08:55 AM


Re: Re: access - ole object - using vb
Bala

Did you ever figure out how to do this?

Thanks,
Dortoh

Report this thread to moderator Post Follow-up to this message
Old Post
dortoh
12-21-05 04:52 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Visual Basic archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:22 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.