Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 FileSystemObject question
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

andygenge
Starting Member

United Kingdom
30 Posts

Posted - 17 July 2001 :  12:06:45  Show Profile
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  Show Profile  Visit Kat's Homepage
Why do you need the FSO?

KatsKorner
Go to Top of Page

andygenge
Starting Member

United Kingdom
30 Posts

Posted - 17 July 2001 :  12:20:08  Show Profile
What other ways can I check wether a file exisits in a directory?

Go to Top of Page

Id
Junior Member

USA
129 Posts

Posted - 17 July 2001 :  13:34:47  Show Profile  Visit Id's Homepage
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
Go to Top of Page

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 18 July 2001 :  04:16:34  Show Profile  Visit Kat's Homepage
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
Go to Top of Page

andygenge
Starting Member

United Kingdom
30 Posts

Posted - 18 July 2001 :  05:06:28  Show Profile
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

Go to Top of Page

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 18 July 2001 :  05:49:27  Show Profile  Visit Kat's Homepage
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
Go to Top of Page

andygenge
Starting Member

United Kingdom
30 Posts

Posted - 18 July 2001 :  06:00:50  Show Profile
Just bored and trying to show off to the board :0) Also server processor time is not really a concern.

Go to Top of Page

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 18 July 2001 :  06:10:05  Show Profile  Visit Kat's Homepage
Fair enough.. but as my boss always says - don't do stuff just because you can! Do it because it is required.

KatsKorner
Go to Top of Page

andygenge
Starting Member

United Kingdom
30 Posts

Posted - 18 July 2001 :  06:49:33  Show Profile
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

Go to Top of Page

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 18 July 2001 :  07:42:03  Show Profile  Visit Kat's Homepage
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.3 seconds. Powered By: Snitz Forums 2000 Version 3.4.07