Solved

insert image to access database...

Posted on 2002-05-23
5
289 Views
Last Modified: 2012-06-22
i found a solution in msdn library but cannot work. the solution is as follow:-

Data1  Database Name  C:\TEMP\db1.mdb  
Data1  RecordSource  MyOLETest  
OLE1  DataSource  Data1  
OLE1  DataField  Picture  


Double-click Command1 , and then paste the following code into the Command1 Code window:


Data1.Recordset.AddNew
OLE1.CreateEmbed "C:\Windows\Circles.bmp"
' Assume the bitmap file is located at C:\Windows\ folder.
Data1.Recordset.Update
Data1.Recordset.MoveLast

p/s: when i want to set the OLE1.datasource it pops up an error "member not found"
Please help...
0
Comment
Question by:green_tea
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7029152
I have tried with success:

Private Sub Form_Load()
  Data1.Refresh
  Data1.Recordset.AddNew
  OLE1.CreateEmbed "E:\myfile.bmp"
  Data1.Recordset.Update
  Data1.Recordset.MoveLast
End Sub

With the table MyOLETest  having the fields
* ID (Autonumber + primary field)
* Picture (OLE)

CHeers
0
 
LVL 3

Accepted Solution

by:
SirNick earned 25 total points
ID: 7029155
Hi green tea

Have a look at the following links

http://www.freevbcode.com/ShowCode.Asp?ID=3539

and

http://www.freevbcode.com/ShowCode.Asp?ID=589

Hope this helps...
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 7029790
Please maintain your open questions:

Questions Asked 5
Last 10 Grades Given B  
Question Grading Record 1 Answers Graded / 1 Answers Received

Anthony
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7818441
Hi green_tea,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Split points between: angelIII and SirNick

green_tea, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 7910097
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange

angelIII points for you at:
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20505890.html
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
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…
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…

726 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