I am a complete ASP newbie and I have to modify/fix someone else's code, so please be very detailed when answering, i.e. where to place the code.
History:
> 1. I have code that when used in a file it dynamically pulls information
> from a text database (database.txt). It is strictly a text file.
>
> 2. The file(s) with the dynamic code also does some image morphing.
>
>
Problem:
> In the database.txt file there is the name O'Brien. The images will not
> morph unless I remove the apostrophe from O'Brien.
>
> This is part of the code in the database.txt file:
> Jane OBrien
> obrien.asp
> Instructional Designer II
> o
> Instructional Design and New Business
>
>
> This is the code in the non database file:
> 'create second counter
> counter2 = 0
>
> 'change the line below if the name of this group changes
> ID = "Instructional Design and New Business"
> %>
>
> <script language="JavaScript1.1">
> <!--
> <%
> 'create the fso object
>
> set fso = Server.Createobject("Scripting.FileSystemObject")
>
> 'create file path to database
>
> abspath = server.mappath(Session("VirtualBasePath")) &
> "\about_sdu\whos_who\"
> path = abspath & "database.txt"
>
> 'open the file
>
> set file = fso.opentextfile(path, 1)
>
> 'create counter
>
> counter = 1
>
> 'search through database
>
> do until file.AtEndOfStream
>
> name = file.ReadLine
> bio = file.ReadLine
> title = file.ReadLine
> alpha = file.ReadLine
> group = file.ReadLine
> file.ReadLine
>
> strG = group
> if trim(group) = ID then
> response.write "var image" & counter & "=new
> Image();" & chr(10) & chr(13) & "image" & counter &
> ".src='../../images/about_sdu/associates/" & name & ".jpg';" & chr(10) &
> chr(13)
> counter = counter + 1
> end if
> do while instr(strG, "/")
> splitGroup = Left(strG, instr(strG, "/") - 1)
> if trim(splitGroup) = ID then
> response.write "var image" & counter & "=new
> Image();" & chr(10) & chr(13) & "image" & counter &
> ".src='../../images/about_sdu/associates/" & name & ".jpg';" & chr(10) &
> chr(13)
> counter = counter + 1
> end if
> strG = Right(strG, len(strG) - instr(strG, "/"))
> if strG <> splitGroup then
> if trim(strG) = ID then
> response.write "var image" & counter
> & "=new Image();" & chr(10) & chr(13) & "image" & counter &
> ".src='../../images/about_sdu/associates/" & name & ".jpg';" & chr(10) &
> chr(13)
> counter = counter + 1
> end if
> end if
> loop
>
> loop
>
> ' close and clean up
>
> file.close
> set file = nothing
> set fso = nothing
> %>
>
>
> //-->
> </script>
> <script language="JavaScript1.2">
> function reapply(){
> setTimeout("slideit()",3000)
> return true
> }
> window.onerror=reapply
> </script>
> <script>
> <!--
> //change speed below (in seconds)
> var speed=3
> var random
> var destHREF
> Link=new Array()
> <%
> 'create the fso object
>
> set fso2 = Server.Createobject("Scripting.FileSystemObject")
>
> 'create file path to database
>
> abspath2 = server.mappath(Session("VirtualBasePath")) &
> "\about_sdu\whos_who\"
> path2 = abspath2 & "database.txt"
>
> 'open the file
>
> set file2 = fso2.opentextfile(path2, 1)
>
> 'create counter
>
> counter2 = 0
>
> 'search through database
>
> do until file2.AtEndOfStream
>
> name = file2.ReadLine
> bio = file2.ReadLine
> title = file2.ReadLine
> alpha = file2.ReadLine
> group = file2.ReadLine
> file2.ReadLine
>
> strG = group
> if trim(group) = ID then
> response.write "Link[" & counter2 & "]='associates/"
> & trim(bio) & "';" & chr(10) & chr(11)
> counter2 = counter2 + 1
> end if
> do while instr(strG, "/")
> splitGroup = Left(strG, instr(strG, "/") - 1)
> if trim(splitGroup) = ID then
> response.write "Link[" & counter2 &
> "]='associates/" & trim(bio) & "';" & chr(10) & chr(11)
> counter2 = counter2 + 1
> end if
> strG = Right(strG, len(strG) - instr(strG, "/"))
> if strG <> splitGroup then
> if trim(strG) = ID then
> response.write "Link[" & counter2 &
> "]='associates/" & trim(bio) & "';" & chr(10) & chr(11)
> counter2 = counter2 + 1
> end if
> end if
> loop
>
>
> loop
>
> ' close and clean up
>
> file2.close
> set file2 = nothing
> set fso2 = nothing
> %>
>
> //-->
> </script>