Author |
Topic |
|
andygenge
Starting Member
United Kingdom
30 Posts |
Posted - 17 July 2001 : 12:06:45
|
Hi,
I am trying to create a database search which displays every name in a database. If the person has a photo of them availiable in a directory then a hyper link to the photo is displayed.
|
|
Kat
Advanced Member
United Kingdom
3065 Posts |
Posted - 17 July 2001 : 12:14:43
|
Why do you need the FSO?
KatsKorner
|
|
|
andygenge
Starting Member
United Kingdom
30 Posts |
Posted - 17 July 2001 : 12:20:08
|
What other ways can I check wether a file exisits in a directory?
|
|
|
Id
Junior Member
USA
129 Posts |
Posted - 17 July 2001 : 13:34:47
|
you should just have a database set up where people insert a link to their picture, that when you just do a query on the database and run code like this
<% If rsSearch("p_hyperlink") <> "" Then Response.Write "<a href="" & rsSearch("p_hyperlink") & """>View Picture</a>" End If %>
Where p_hyperlink is the name of your database field with the picture and rsSearch is your recordset
That's probably the easiest method, that way you don't have to worry whether or not your server has support for FSO
Edited by - Id on 17 July 2001 13:36:20 |
|
|
Kat
Advanced Member
United Kingdom
3065 Posts |
Posted - 18 July 2001 : 04:16:34
|
That is exactly what I was thinking. When the photo is uploaded to the directory, create a field value in the database table against them to say there is a photo and store its filename. Then just check this and use it if it exists.
No FSO, no problem.
Any good to you?
KatsKorner
|
|
|
andygenge
Starting Member
United Kingdom
30 Posts |
Posted - 18 July 2001 : 05:06:28
|
Thanks for that, but that is what I already have in place a 1/0 entry in a database field if there is a photo it then displays the photo. I was just trying to be clever and simplify the admin work.
All the photos are save as first name, surname .jpg so I know what file names to search for in a telephone directory.
If I succeed I shall definatley post it, I basically need to search the database tables matching the names and then for each name search the directory for a photo called name.jpg
Andy
|
|
|
Kat
Advanced Member
United Kingdom
3065 Posts |
Posted - 18 July 2001 : 05:49:27
|
Doesn't sounds all that efficient to do it that way.
Why not keep it simple?
If all the photos are going to be stored in one place, then you know the directory. You said you already know the names so I can't see why you want to complicate the processing. There is no need.
Just my opinion.
KatsKorner
|
|
|
andygenge
Starting Member
United Kingdom
30 Posts |
Posted - 18 July 2001 : 06:00:50
|
Just bored and trying to show off to the board :0) Also server processor time is not really a concern.
|
|
|
Kat
Advanced Member
United Kingdom
3065 Posts |
Posted - 18 July 2001 : 06:10:05
|
Fair enough.. but as my boss always says - don't do stuff just because you can! Do it because it is required.
KatsKorner
|
|
|
andygenge
Starting Member
United Kingdom
30 Posts |
Posted - 18 July 2001 : 06:49:33
|
Is that why you are reading this.
This seems to work <% set jp = conn.execute(SQL) %> <%' just check if there are any people 'in the database
if jp.eof then response.write ("sorry, no results have been returned") end if %> <%do while not jp.eof%> <TR> <TD WIDTH="20" ALIGN="CENTER">
<%' the table add html if file exists for each objFile in objFiles%> <%if objFile.Name = trim(jp(1)) then%> <%response.write ("weyhay") end if %> <%next%>
in this case the file jp(1) is called Andrew I can't seem to add .jpg at the end or jp(2) the surname.
Andy
|
|
|
Kat
Advanced Member
United Kingdom
3065 Posts |
Posted - 18 July 2001 : 07:42:03
|
quote:
Is that why you are reading this.
ha ha.. I am always on here. I like it here...
See, you couldn't stop playing could you? I hope it does work - I am not going to test it cos I am working really...
Catch you later Andy!
KatsKorner
|
|
|
|
Topic |
|