Solved

How do display an MS Access Ole Object within VB6?

Posted on 2004-08-11
9
1,117 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need VBS version of Excel date conversion 4 65
Visual Basic Excel Formatting error 4 83
JSON Response and request in VB6 application 11 250
Access 2013 combo box not working 3 38
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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

895 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

15 Experts available now in Live!

Get 1:1 Help Now