OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

File paths in image controls of forms

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
pago
General User
General User


Joined: 10 Oct 2009
Posts: 6

PostPosted: Sat Oct 10, 2009 12:19 pm    Post subject: File paths in image controls of forms Reply with quote

I am trying to rebuild in ooBase under Windows (OOO310m11, build:9399) a database which has hundreds of images. In arranging the form that has to properly display the information of each record, including its related image, I find problems in the naming of these image files.

I intend to keep the images outside of the database, i. e. to use them by a reference contained in a field of one of the tables of the database. The 'Image control' provided by the ooBase form system to display the image has among its 'Data properties' one apparently conceived specifically for the purpose of locating this field.

The question is how each concrete image file has to be named in this field of each record for the mechanism to work.

The only way I have found until now after many trials is by what I would call 'inmediate reference', i. e. writing something as 'Meninas.png', which implies that the file 'Meninas.png' resides in the same folder as the database file 'Arte.odb'. I consider that only jokingly could this be termed 'a solution' and in any case it is unacceptable for my purposes. Specifying a full filepath (for instance, 'D:/Arte/Museos/Prado/Velázquez/Meninas.jpg') does not work, much less a relative reference (for instance, './Museos/Prado/Velázquez/Meninas.jpg'), as it should be, which would point to a whole tree under the database folder in order to make the whole document robust. (Putting '\' bars instead of '/' bars in the name does not work either; the accented characters have also nothing to do with the problem.)

Interestingly enough if the image is specified in the 'Image' property of the 'General' group (which of course is useless for the intended use, as it will display the same image for all the records), the absolute reference ('D:/Arte/Museos/Prado/Velázquez/Meninas.jpg') works, but the relative one ('./Museos/Prado/Velázquez/Meninas.jpg') keeps not working.

Is there some 'magic turn' to the subject that I have not yet fallen upon and would make the thing work as it should? I have not located any previous information about this subject in the archives.

Many thanks in advance!
Back to top
View user's profile Send private message
RPG
Super User
Super User


Joined: 24 Apr 2008
Posts: 2697
Location: Apeldoorn, Netherland

PostPosted: Sat Oct 10, 2009 2:16 pm    Post subject: Reply with quote

Hello

use url

There are basic functions
ConvertToURL
ConvertFromURL


http://www.oooforum.org/forum/viewtopic.phtml?t=73329

Romke
Back to top
View user's profile Send private message
pago
General User
General User


Joined: 10 Oct 2009
Posts: 6

PostPosted: Sat Oct 17, 2009 1:31 pm    Post subject: File paths in image controls of forms Reply with quote

Thank you, Romke, for your reply and your hints.

They were useful for understanding that in OOffice the URL notation is the standard notation for whole filenames (i. e., including the whole path) and that therefore other notations (like Windows one) do not work (or could not work, because it seems that they sometimes do).

Your 'begintoon' macro was also useful as a working example of the way that it is necessary to follow for displaying a changing image in an image control.

Meanwhile I have read many other documents about OOffice (mainly 'OOOBasic.pdf' and 'AndrewMacro_2006-01-25.zip'), about its macros and its ways of doing things. There are many concepts that keep being rather nebulous and confuse for me, but this will also probably improve with time and effort.

With this knowledge I have solved by now my more pressing problem, which was the necessity of working with relative paths, and have tried to do it in a general way, although I know too little yet about OOffice to be sure of it. This is an aspect about which I have found no other information available, which is a little surprising. It is true that the problem is more pressing in the case of big databases than with ordinary Writer or Calc documents. There seems to be no discussions about these very real cases and very little about databases in general. I find the official documentation of OOffice rather mean and confuse about this particular.

If you are interested in this subject I will gladly share my code with you.

Paco
Back to top
View user's profile Send private message
RPG
Super User
Super User


Joined: 24 Apr 2008
Posts: 2697
Location: Apeldoorn, Netherland

PostPosted: Sat Oct 17, 2009 4:18 pm    Post subject: Reply with quote

Hello Paco

It is nice you are glad with the code.

In an other thread I have told a little about forms and there you can also find some links for tutorials about OOo-base and SQL.

If you have an important database then it is maybe useful to read about
shutdown defrag
checkpoint defrag.
http://www.oooforum.org/forum/viewtopic.phtml?t=52208&highlight=shutdown

Also important is: make sometimes a backup. The costs are little and more security.

I don't know much about databases but for better information read posts of Villeroy. He explains it good and easy. For information about SQL read posts of Sliderule.

Romke
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group