Solved

How do display an MS Access Ole Object within VB6?

Posted on 2004-08-11
9
1,128 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

770 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