Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Indexing ASP database

2 views
Skip to first unread message

Russ Wittmann

unread,
Jan 12, 2001, 1:56:06 PM1/12/01
to
Does index server query the database and return results?
My question is I have both static and dynamic pages i want indexed so when i
search for a word such as oil and it finds matching results it will bring back
the file like this http://www.domain.com/page.asp?ID=4

Is this possiable if so how?

Thanks,
-Russ

hilary...@pharma.novartis.com

unread,
Jan 12, 2001, 3:32:23 PM1/12/01
to
no it doesn't what you have to do is write a script that will connect
to the database and then write html pages for index server to index.

Check out this link for more information.
http://msdn.microsoft.com/library/default.asp?URL=/library/backgrnd/html
/msdn_istips.htm

if you need these scripts let me know and I will post them.


Sent via Deja.com
http://www.deja.com/

Russ Wittmann

unread,
Jan 12, 2001, 3:56:26 PM1/12/01
to
yes please post the scripts i will be indexing my sql DB.

-Russ

.

hilary...@pharma.novartis.com

unread,
Jan 15, 2001, 12:16:15 PM1/15/01
to
Here is a sample script used to build these files and after that a
query file that is used to do resolution.
'this scripts reads a SQL database with a table of two columns, the
first column containing a record id, and the second column containing
the body of the text you 'wish to index
Set oFS = CreateObject("Scripting.FileSystemObject")
set oConn=CreateObject("ADODB.Connection")
set oRs=CreateObject("ADODB.Recordset")
oConn.Open "DRIVER=SQL Server;SERVER=SQL SERVER
NAME;UID=sa;PWD=;DATABASE=articles;"
set oRs.ActiveConnection=oConn
oRs.Open "select id, body from exchange"
do while not oRs.EOF
set Ts=ofs.CreateTextFile(oRs.Fields(0)& ".htm")
Ts.WriteLine "<HTML><BODY>"
Ts.WriteLine oRs.Fields(1)
Tts.WriteLine "</BODY></HTML>"
Ts.Close
set Ts=nothing
oRs.MoveNext
loop

run this in a directory. I have run it in a virtual directory called
temp which is inside of my c:\inetpub\wwwroot directory. (make sure
you have index server do a full rescan of this directory.

Here is the sample query file - note that when it detects a vpath of
/temp it changes the a href to point to a page that connects to the
database and retrieves the file, instead of returning the file - notice
here I am searching for files containing the word exchange - I leave it
up to you to write the database.asp file (contact me again if you need
this code as well).

<HTML>
<BODY>
<table width="100%" border="0" cellspacing="0" cellpadding="0"> <%
set Rs=server.createobject("ADODB.RecordSet")
rs.Open "SELECT path, vpath, filename, characterization from
WEB..SCOPE() WHERE(contains(CONTENTS,'exchange'))","Provider=MSIDXS"
Response.Write "<TABLE WIDTH=80% BORDER=1>"
Response.Write "<TR>"
Response.Write "<TD><B>Path</B></TD><TD><B>characterization</B></TD>"
Response.Write "</TR>"
WHILE NOT RS.EOF
if rs(1) ="/temp/" & rs(2) then
response.write "<TR><TD><a href=database.asp?"& rs(2) & ">" & rs(2) &
"</a></TD><TD>" & rs(3) & "</TD></TR>"

else
response.write "<TR><TD><a href="& rs(1) & ">" & rs(2) &
"</a></TD><TD>" & rs(3) & "</TD></TR>"
end if
RS.MoveNext
WEND
response.write "</table>"
%>
</BODY>
</HTML>

Russ

unread,
Jan 26, 2001, 12:28:52 PM1/26/01
to
how is this used where do i out the files i have to do this trough my isp?
How is this done? Sorry i sound so stupid but i am confused. Can i trouble
you to break it down a little more? What do i name the script?

Thanks
-Russ

<hilary...@pharma.novartis.com> wrote in message
news:93vb8m$n1n$1...@nnrp1.deja.com...

hilary...@pharma.novartis.com

unread,
Jan 26, 2001, 2:04:16 PM1/26/01
to
To answer your questions

Create a vbs script, call it anything and run it in the temp virtual
directory. It will create all of the html files in your temp directory.

I hope this answers your question.


In article <uRZW7z7hAHA.1728@tkmsftngp02>,

0 new messages