Solved

How to display image without storing it in table

Posted on 1998-09-04
9
198 Views
Last Modified: 2012-06-27
The Deluxe CD player that comes with Plus98 for Win98 saves CD info as an Access database. I've created a database with links to this, and have also scanned the CD covers.  My form then shows the relevent cover and CD info.

My problem is that no matter what I try, the image is embedded in the table which is now around 100MB in size even though the images total around 3.5MB.  I've searched Microsoft's Knowledgebase and have found:

INF: How to Display Image in Form Without Storing It in Table

Article ID: Q148463

However this solution relies on you manually typing the graphic filename and path into the table.  Is there a way that you can call up an open file style dialog box so that this can populate the table with the file info?  If someone has an answer and says "Yes, just do it in VB" could they provide the step by step guide!

Thanks

JR
0
Comment
Question by:Rudgej
  • 6
  • 3
9 Comments
 

Author Comment

by:Rudgej
ID: 1961273
Edited text of question
0
 
LVL 8

Accepted Solution

by:
Helicopter earned 100 total points
ID: 1961274
On  your form place a common dialog control(called cdlg) and put this code behind a command button. Have ab textbox (txtPicture) bound to your field where you want to store the name.

Private Sub cmdpicture_Click()

On Error GoTo err_cmdpicture_Click

Me.cdlg.ShowOpen
If Not IsNull(Me.cdlg.FileName) Then
Me.txtpicture = cdlg.FileName
End If

exit_cmdpicture_Click:
Exit Sub

err_cmdpicture_Click:
MsgBox Error$
Resume exit_cmdpicture_Click
End Sub
0
 

Author Comment

by:Rudgej
ID: 1961275
Thanks Helicopter,

I've no experience in coding, would you mind explaining in a bit more detail how I put a common dialog control on the form?  NB, I'm using Access 7.0, is this a feature only available from Access 97?

Regards

JR
0
 
LVL 8

Expert Comment

by:Helicopter
ID: 1961276
No, it's in 7 too

I don't have 7 handy, but in 8 you have to go to extra controls and look for Microsoft Common Dialog control. It's either on your toolbox or a menu item. Select it and use it like
an ordinary control.

I don't have access to v7 until Monday, but look under activeX or added controls.....you'll find it I'm sure

0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:Rudgej
ID: 1961277
Are how hanging around on-line or what!

I can select a Microsoft Common dialog Control 5.0 (SP2) from Insert | Custom Control, however it then tells me that I don't have the licence required to use this control.  I'll look on my Office 95 CD and see if there are optional controls that can be installed and that I haven't done so.

Thanks

JR
0
 

Author Comment

by:Rudgej
ID: 1961278
Are how hanging around on-line or what!

I can select a Microsoft Common dialog Control 5.0 (SP2) from Insert | Custom Control, however it then tells me that I don't have the licence required to use this control.  I'll look on my Office 95 CD and see if there are optional controls that can be installed and that I haven't done so.

Thanks

JR
0
 
LVL 8

Expert Comment

by:Helicopter
ID: 1961279
I'm here yes....

I got that error using 7 as well. See if you have another version of the control
0
 

Author Comment

by:Rudgej
ID: 1961280
I don't have any other common dialog controls that I can find.  I do however have a copy of VB5 (I thought I might get round to learning it)  - so I'll install that and see if I can get anywhere with the controls from that.

I'll let you know.

Regards

JR
0
 

Author Comment

by:Rudgej
ID: 1961281
I came across a solution on the Knowledgebase "ODE97: "You don't have a license" Error Using Activex Control ID Q172859.  The problem in not being able to use the common dialog was that run-time versions of the controls had been installed, and when the "proper" ones were installed (e.g. by VB5)the OCX files and the corresponding dependency files were not installed.  The solution was to download odelic.exe - however this only works for Office 97 Developer Edition Tools - and not for Office 95.  I got round this by uninstalling the VB5 and renaming comctl32.ocx and comdlg32.ocx, and then reinstalling VB5.

Thanks for your help.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

758 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

20 Experts available now in Live!

Get 1:1 Help Now