Link to home
Start Free TrialLog in
Avatar of RUSS_EMI
RUSS_EMI

asked on

How do display an MS Access Ole Object within VB6?

Simple.  But I'm missing something.  Please help correct my code.  I have Ole1 object control on the form.  Here is my code so far;

sSQL1 = "SELECT * FROM Employees WHERE Employees.fkAlpha = " + "'" + Me.FkAlpha2 + "'"

   Set DB = OpenDatabase("c:\employees.mdb")
   Set rst = DB.OpenRecordset(sSQL1)
   rst.MoveLast
   rst.MoveFirst
   MsgBox rst!Name
   
The record is being selected properly.  rst!Name does display.
Thanks,
Russ

Avatar of Farzad Akbarnejad
Farzad Akbarnejad
Flag of Iran, Islamic Republic of image

Hi,
How to verify of selecting the record properly?

-FA
Avatar of RUSS_EMI
RUSS_EMI

ASKER

it is the correct record because i ask for a match on the key. (fAlpha)
Russ
Please verify the rst.RecordCount. Is it > 0 ?

-FA
Yes it is.  I have the record.  I can display rst.RecordCount (1) with MsgBox; Text1,text; etc.  Please how do I display the Ole1 control.  I would like to display the Ole Object in MS Access, the field name is "Picture".
Russ
ASKER CERTIFIED SOLUTION
Avatar of Farzad Akbarnejad
Farzad Akbarnejad
Flag of Iran, Islamic Republic of image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks.  I'll try that tomorrow and get back to you.
Russ
Are you solev your problem. You can post your comment here if you don't solve it yet.

Thanks
-FA