Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

converting strings to ole objects

Status
Not open for further replies.

aidenryan

Programmer
May 18, 2001
14
0
0
CA
If I have a string type variable that is a file path name,
such as,

Dim strFile As String

strFile = "C:\image.bmp"

is there any way to convert that string to an OLE oject using VB code. If so, I would appreciate some help.
 
On a visual basic form, I have a text box in which the user can enter a file path name. I want to store that file path in a access db table. That part I know. However, if the path is for a bitmap or something else that can be stored as an OLE object, I want to store it in another table as an OLE Object.
This is quite a problem for me.
 
I've answered a similar question on thread 222-104381.

Any way here's a copy paste of my answer(this was for a .doc file, for a .bmp or similar it's just the same thing):


Just create a field on your table of the type OLE object, than you embed your word documents there.

If you have your documents stored on disk and want to place it on your database you can use the GetChunk/AppendChunk methods for the job.
You can get a preety good example on how to work with this at:


I'm not sure if the above method will work for what you want, other way of doing it is to use the stream object for the task.

PS: I myself prefer to stick around with the stream object, but that's just my personal opinion

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top