查询从文件系统(而不是数据库)显示图片 [英] Query to Display Picture from File System (not Database)

查看:81
本文介绍了查询从文件系统(而不是数据库)显示图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题多么糟糕。我花了两周的时间试图让它简洁明了,我不能。我没有这个问题的词汇。我甚至无法正确地标记它。这是我最大的努力。


条件:

80,000+张照片(这些是鸟类的照片,物种ID,性别,年龄等等(如果已知))

文件夹层次结构:

大陆 - >国家 - >州(如果印度,墨西哥,美国,加拿大和澳大利亚)(无状态)其他国家)


我正在开发一个Access程序来管理这些。当然,主表将包含80,000多条记录,每张图片1条,包含上述所有属性的字段。它还包含图片的[Drive:\Path\]文件名。


我正在写一个过滤器常规选择图片的子集,即美国的乌鸦;或罗马尼亚的所有鸟类,或Genus = Passer(House Sparrow等)。


如果我将图片放在Access中的表格中,它会变得非常大而且很慢,而且它是难以管理。我想将图片放在上面提到的文件夹层次结构中,让微软管理它们。这也让我可以使用各种照片程序,即PhotoShop。所以我拒绝任何包含Access中嵌入图片的解决方案。


如果我的FilterQuery的结果一次是1张图片,我可以这样做。但是,如果我想要一个连续记录的表格,每个表格都显示正确的图片,我不知道该怎么做。任何想法?


要以另一种方式陈述问题,我需要一个返回所请求子集的查询(我可以这样做),但是有另一个字段,PictureOfBird,这是一个图像。然后表单将显示找到的所有图片。 SQL语句必须类似于SELECT Key,PictureFileName,PictureOfBird AS xxx AS Image FROM TablePictures;这不是有效的SQL语句。我使用的是关键字AS。不正确。在SQL中,AS是表示在AccessVB内的别名,AS。表示DataType。我的观点是,我想要一个包含3个字段的表。字段1 =记录密钥;字段2 = PictureFileName(Drive& Path& FileName to Image);字段3 =带图片的图像字段。


目前尚不清楚。如果我的表存储了图像,我可以查询Select Key,PictureName,PictureOfBird FROM TablePictures WHERE Genus ='''Corvus''"并且有一个连续的表格显示我所有的乌鸦和乌鸦的照片。


我希望其中一些是有道理的,因为我没有词汇来真正定义我想要的东西。谢谢。


OldBirdman

What a mess this question is. I have spent 2 weeks trying to make it concise and clear, and I can''t. I do not have the vocabulary for the question. I cannot even TITLE it correctly. Here is my best effort.

Conditions:
80,000+ pictures (These are pictures of birds, ID by Species, Sex, Age, etc. (If known))
Hierarchy of folders:
Continent->Country->State(if India, Mexico, USA, Canada, & Australia) (No state for other countries)

I am developing an Access program to manage these. Of course, the main table will contain 80,000+ records, 1 per picture, with fields for all properties mentioned above. It would also contain the [Drive:\Path\] filename to the picture.

I am writing a "Filter" routine to select a subset of the pictures, i.e. Ravens in USA; or all birds of Romania, or Genus=Passer (House Sparrow, etc).

If I put the pictures in the table within Access, it becomes very large and slow, and it is difficult to manage. I would like to have the pictures in the hierarchy of folders mentioned above, and let Microsoft manage them. This also allows me to get to them with various photo programs, i.e. PhotoShop. So I reject any solution that has the pictures imbedded in Access.

If the result of my FilterQuery is to be 1 picture at a time, I can do that. But if I want a form with continuous records, each showing the correct picture, I don''t know how to do that. Any ideas?

To state the problem another way, I need a query that returns the subset requested (I can do that OK), but has another field, PictureOfBird, that is an image. Then form would display all pictures found. The SQL Statement would have to be something like "SELECT Key, PictureFileName, PictureOfBird AS xxx AS Image FROM TablePictures;" This is not a valid SQL statement. I am using the keyword "AS" incorrectly. In SQL, "AS" means alias, within AccessVB, "AS" means DataType. My point is that I want a table with 3 fields. Field 1=Record Key; Field 2=PictureFileName(Drive&Path&FileName to Image); Field 3=Image Field with picture.

This is not clear. If my table stored the image, I could query "Select Key, PictureName, PictureOfBird FROM TablePictures WHERE Genus=''Corvus''" and have a continuous form showing all my pictures of Crows, and Ravens.

I hope some of this makes sense, as I don''t have the vocabulary to really define what I want. Thank you.

OldBirdman

推荐答案

我现在不能看这个老朋友,但我想我至少得到这个问题。

让我看看后来我能找到的东西。
I can''t look at this now old-buddy, but I think I get the question at least.
Let me see what I can find out later.


归结为能够将图片上传到表单上你去了。

关于每张唱片,可以很容易地检索关于图片存储位置的信息。从那里问题是: -

当显示查询结果时,是否可以逐个记录地获取并显示图片?
It comes down to being able to upload a picture on to the form as you go.
The information as to where the picture is stored can be retrieved easily enough for each record. From there the question is :-
Is it possible to go off, get and display the picture, on a record by record basis, as the query results are shown?


对不起,如果这在逻辑部门有点粗糙,因为我或多或少地教我自己,所以请耐心等待我。


这里有:


在我看来,最好的方法是生成一个具有你想要的值的记录集(这似乎主要是关键和路径)。从那里,记录集将绑定到一个带有两个文本框的表单(一个用于键,一个用于路径信息)和一个图像对象。诀窍是使图像对象链接并从记录集返回的路径动态设置路径。


不幸的是,我无法提供必要的编码,因为我不确定涉及的每一步骤。然而,这是我看起来的方向,因为它似乎可以提供动态解决方案,而无需生成永久表。


希望这会有所帮助。

Minion
Sorry if this is a bit crude in the logic department as I''m more or less teaching myself as I go on things, so pleae bear with me.

Here it goes:

It seems to me that the best way to do this would be generate a recordset with the values you desire (which seem to be primarily the Key and the path). From there the recordset would be bound to a form with two text boxes (one for the Key, one for the path info) and an image object. The trick is making the image object linked and setting the path dynamically from path returned by the recordset.

Unfortunately, I am unable to provide the necessary coding here as I''m not sure of each step involved. However, this is the direction I would look as it seems that it would provide a dynamic solution without having to produce a permanent table.

Hope this helps.

Minion


这篇关于查询从文件系统(而不是数据库)显示图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆