Maybe this is a stupid question, but why bother with the HTML/ASP code at all?

As it is a simple SQL query you're performing you can do this all from within KiXtart.

Example:
Code:

;DBCommand() = http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Board=UBB12&Number=83050
$searchfor='whatever'
$dsn='DRIVER={SQL Server};SERVER=servername;UID=user;PWD=password;DATABASE=mydatabase'
$sql="SELECT Field1, Field2 FROM Table1 WHERE Field3='"+$searchfor+"'"
$recordset = DBCommand($dsn,$sql)
? 'Error = '+@ERROR+' - '+@SERROR
for $row=0 to ubound($recordset,1)
for $column=0 to ubound($recordset,2)
? 'Field(row='+$row+', column='+$column+') ='+$recordset[$row,$column]
next
next

_________________________
There are two types of vessels, submarines and targets.