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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking OLE to Database

Status
Not open for further replies.

mans

Programmer
Mar 18, 2000
136
AU
Hello,

Below is part of a statement that I use to assign a DataSource to a text box:

Adodc1.ConnectionString= "Provider=Microsoft.Jet.OLEDB.4.0;Password=pw;User ID=id;Data Source=" & App.Path & "\db.mdb;Persist Security Info=True;Jet OLEDB:System database=" & App.Path & "\ss.mdw;Jet OLEDB:Database Password=pw"
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "SELECT * From Revenue”

Set Text2.DataSource = Adodc1
Text2.DataField = "Cost"

I would like to do a similar assignment for an OLE object on a VB6 form, can somebody please let me know what code I should use. Putting OLE2 in place of Text2 above does not work. I currently have SP4 installed.

Thank You
 
Thank you for your response.

The answer to your question is Yes.
 
you can not place Ole in TextBox (Ole is a Photo or a Word doc etc...)

referenties OLE Object on the Project or paste you code here what's the problem

Eric De Decker
vbg.be@vbgroup.nl

License And Copy Protection AxtiveX.

Download Demo version on my Site:
 
The OLE is placed in an OLE object on the VB6 form, not a text box. Too put it simply, I have a picture (.bmp) that I pasted onto a OLE object on my VB form which I would like to save to an Access2000 table that contains the appropriate OLE Object field (using ADO). I have tried using the code above (first statement-Text2 should be OLE2) without luck. The program will not let me type OLE2.DataSource and says that the method is not found when I try to execute that the following code:

OLE2.DataSource = Adodc1
OLE2.DataField = "Image"

Am I missing reference file ??

Thank You
 
Hi Guys,

Would you be kind enough to tell me if you already solved this problem. I have almost the same problem with bitmap.

Here's my problem. I'm using VB6 with ADO 2.6 & Access2000. When I try to save the corresponding value of "C:\Pictures\Pic00001.JPG" using Stream or AppendChunk into an OLE Object Field, the saved value is always Long Binary Data. What I need is to save the picture as a Bitmap Image in an OLE Object field so then I can print the picture using CR8.

I'll be waiting for your inputs. Thank you.
 
Did you ever get a solution for this??

I have the same problem now - usinf PNG images though. Works fine is done manually through Access - but need the VB code.

Thanks
Ski
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top