Path names in a database problem 
Author Message
 Path names in a database problem

I'm working on a VB application that uses a data control linked to an
Access database. I have a few edit boxes linked to various fields in the
database, no problem there. My problem is, I have a picture box that I
want to link to a data field in the same batadase, however that field
only contains the path name to the jpeg that I want it to display as the
user moves through the database. When I try to link the picture box
control to the picture field in the database which actually just
contains the path to the associated jpeg file as a text string, of
course I get an error.

So my question is: how can I get vb to dynamicly display the jpeg files
in the picture box control as the user moves through the database when
all I have is a path string in the data field?

Thanks for any help or sympathy

Ric Gibson



Sat, 06 Nov 1999 03:00:00 GMT  
 Path names in a database problem

Hello Ric

Don't bind the Picture control to the datacontrol.  Instead do this:

Sub Data1_Reposition()

        Picture1.Picture = LoadPicture(Data1.Recordset("PicturePath"))

End Sub

You add the error handling for invalid path :-)

--
Ibrahim Malluf
a MS Dev. MVP
_____________________
Malluf Consulting Services

=====================
Read about my horror story
with Compuweb.com
http://www.rt66.com/iymalluf/compuweb.html



Quote:
> I'm working on a VB application that uses a data control linked to an
> Access database. I have a few edit boxes linked to various fields in the
> database, no problem there. My problem is, I have a picture box that I
> want to link to a data field in the same batadase, however that field
> only contains the path name to the jpeg that I want it to display as the
> user moves through the database. When I try to link the picture box
> control to the picture field in the database which actually just
> contains the path to the associated jpeg file as a text string, of
> course I get an error.

> So my question is: how can I get vb to dynamicly display the jpeg files
> in the picture box control as the user moves through the database when
> all I have is a path string in the data field?

> Thanks for any help or sympathy

> Ric Gibson



Sat, 06 Nov 1999 03:00:00 GMT  
 Path names in a database problem

Ibrahim,

Thanks for responding to my post.
Your solution to my problem worked beautifuly!

Thank you so much for your help.

Regards,

Ric Gibson



Sun, 07 Nov 1999 03:00:00 GMT  
 Path names in a database problem

Quote:
>So my question is: how can I get vb to dynamicly display the jpeg files
>in the picture box control as the user moves through the database when
>all I have is a path string in the data field?

Use a bound label for the file (or no bound control for that field at all)
Use unboud picture box to show pic.


Sun, 07 Nov 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Retrieving Full Database Path Name

2. Current database path name

3. Set Database Name property using no path

4. Passing Database name and path

5. Set Database name using no path

6. Picking up path name of Access Database

7. App.Path only returning short path name - Why?

8. app.path only returns short path name

9. Long Path Names give Runtime error 76 - Path not found

10. ? How do you change a path to a dos path name

11. App.Path returns "short" path name

12. Best method of determining path, relative path and/or flie name

 

 
Powered by phpBB® Forum Software