I'm in the progress of writing ajax applications. Here is my code

testajax.asp

<input type="text" name="pro_icno2" size="25" maxlength="19" onBlur="showCustomer(document.form, this.value)" disabled />


jsfunction.js

var xmlHttp

function showCustomer(frm,str)
{

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Your browser does not support AJAX!");
return;
}
var url="getcustomer.asp";
url=url+"?q="+str;
alert (url)
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged(frm);
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged(frm)
{
if (xmlHttp.readyState==4)
{
var xmlDoc=xmlHttp.responseXML.documentElement;
frm.pro_buyer.value = xmlDoc.getElementsByTagName("pro_buyer")[0].childNodes[0].nodeValue;

}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}



getcustomer.asp
<%
response.expires=-1
response.contenttype="text/xml"

sql="SELECT * FROM prospect WHERE pro_icno="
sql=sql & "'" & request.querystring("q") & "'"

set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("../db/prospectivebuyer.mdb"))
set rs = Server.CreateObject("ADODB.recordset")
rs.Open sql, conn

response.write("<?xml version='1.0' encoding='ISO-8859-1'?>")
response.write("<company>")
response.write("<pro_buyer>" &rs.fields("pro_buyer")& "</pro_buyer>")
response.write("</company>")

set rs=nothing
set conn=Nothing

%>

Base on the above source code, i get type mismatch error. Appreciate that someone can guide me thru to solve this problem.

Many Thanks