Help needed with ASP & Access searching

J

John

I hope someone can help.

I have an MS Access driven website using ASP (not ASP.NET)

When a record is deleted I first need to delete any image files associated with that record.

The images are contained in an 'images' folder.

The references to these files are contained witin objRS("Article") as a normal hyperlink,
ie...href="........ etc

What I need to do is...
a) search the record for these references
b) extract the filename which will be either jpg,gif or bmp files
c) delete the file from the 'images' folder

I can do c myself once I know the filename.

I hope I have explained enough.

Can anyone help please?

TIA
 
S

Stefan B Rusynko

Find the image filename string using

<%
SearchString ="http://www.yoursite/images/yourimg.ext"
SearchChar = "/"
StartPos = InstrRev(SearchString, SearchChar)-1
ImgFileNameString= Right(SearchString,Len(SearchString)-StartPos)
%>

PS
You would be better off storing the image filename only in a separate DB field and the DB images in a separate folder w/ a unique
name
--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


|I hope someone can help.
|
| I have an MS Access driven website using ASP (not ASP.NET)
|
| When a record is deleted I first need to delete any image files associated with that record.
|
| The images are contained in an 'images' folder.
|
| The references to these files are contained witin objRS("Article") as a normal hyperlink,
| ie...href="........ etc
|
| What I need to do is...
| a) search the record for these references
| b) extract the filename which will be either jpg,gif or bmp files
| c) delete the file from the 'images' folder
|
| I can do c myself once I know the filename.
|
| I hope I have explained enough.
|
| Can anyone help please?
|
| TIA
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top