Link to home
Start Free TrialLog in
Avatar of green_tea
green_tea

asked on

insert image to access database...

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...
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

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
ASKER CERTIFIED SOLUTION
Avatar of SirNick
SirNick

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Please maintain your open questions:

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

Anthony
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
Avatar of SpideyMod
SpideyMod

per recommendation

SpideyMod
Community Support Moderator @Experts Exchange

angelIII points for you at:
https://www.experts-exchange.com/questions/20505890/points-for-angelIII-re-20303798.html