Solved

insert image to access database...

Posted on 2002-05-23
5
285 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
5 Comments
 
LVL 142

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

708 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

12 Experts available now in Live!

Get 1:1 Help Now