Solved

How do display an MS Access Ole Object within VB6?

Posted on 2004-08-11
9
1,104 Views
Last Modified: 2013-12-25
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

0
Comment
Question by:RUSS_EMI
  • 4
  • 3
9 Comments
 
LVL 14

Expert Comment

by:Farzad Akbarnejad
ID: 11770208
Hi,
How to verify of selecting the record properly?

-FA
0
 

Author Comment

by:RUSS_EMI
ID: 11770418
it is the correct record because i ask for a match on the key. (fAlpha)
Russ
0
 
LVL 14

Expert Comment

by:Farzad Akbarnejad
ID: 11770437
Please verify the rst.RecordCount. Is it > 0 ?

-FA
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:RUSS_EMI
ID: 11770521
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
0
 
LVL 14

Accepted Solution

by:
Farzad Akbarnejad earned 500 total points
ID: 11784197
I think that you can add a Data Control to your Forms. Also add an OLE control to your form. Both are intrinsic control in your ToolBox Window. Now set the data control to you DB and set the Datasourse and DataField of your OLE Control.

Thanks
-FA
0
 

Author Comment

by:RUSS_EMI
ID: 11787445
Thanks.  I'll try that tomorrow and get back to you.
Russ
0
 
LVL 14

Expert Comment

by:Farzad Akbarnejad
ID: 11988088
Are you solev your problem. You can post your comment here if you don't solve it yet.

Thanks
-FA
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now