in say, a dictionary of terms with definitions, (in a database) how can i hyperlink (automatically) words within the definitions for which a definition also exists. url structure is like this www.site.com/glossary?word=someword Then - in the definition of "someword" there is a word that also has a definition in the database. I'd like to auto hyperlink it to that definition. any ideas?
When your running through your loop of text to display find and wrap your word: so say your doing a loop and this is what will be outputted: www.site.com/glossary?word=someword1 Copy for someword1 www.site.com/glossary?word=someword2 copy for someword2 www.site.com/glossary?word=someword3 copy for someword3 in each loop iteration do a replace(currentCopyBlock, wordTerm, "<a href=""http:www.site.com/glossary?word=" & wordTerm & """>blah</a>") this should replace your current wordTerm with anchor around + the word term your looking for
if you are talking about something like itellitext does, then you'll need to learn some JavaScript. Besides your URLs don't work
Thanks! one question though - since the data is all coming from a database, what if one of the words to be replaced has not yet come up in the loop? (...or would it be okay since EVERYTHING should be in the recordset? Also - in each copyblock, there could potentially be multiple wordTerms - would this work here too? I'll actually set up an experiment with this one later. Thanks again!
multiple wordterms - just do multiple replaces - take your wordTerms - split it into an array - then run through the array in an inner loop doing replaces. If you have data that needs to be checked against, but doesn't exist (yet) - then run through the loop, build an array of terms, then run through the loop again - comparing against the array you just built with the first loop.
yeah that makes sense. I'm wondering about the efficiency of this though. with an access database with over 1000 terms, couldn't this get resourse intensive?
a thousand records is nothing, Just remember: GetRows! Create your DB Connection, run your query, if their are more than 0 records, then use the GetRows function to convert your recordset into a 2-dim array. Now close your connection. So before anything is calculated - your DB Connection is already closed Now it's simply running through loops of arrays that already in memory. I can understand your concern though because if you did all your calculations while the DB connection is open - and their are 100 concurrent users - your system will bog down like a mo'fo. Thank God for GetRows