dcsimg
type mismatch error - for Ajax
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   jennifer_yan
Posted On:   Wednesday, July 18, 2007 03:49 AM

I'm on the progress on getting data from MS Access database to be post it to textarea, but a type mismatch error was prompt. Enclosed on the source code, appreciate that you can help me to debug the above problem. testajax.asp function.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();    More>>

I'm on the progress on getting data from MS Access database to be post it to textarea, but a type mismatch error was prompt.



Enclosed on the source code, appreciate that you can help me to debug the above problem.



testajax.asp




function.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_company.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(" ")

response.write(" " &rs.fields("pro_buyer")& " ")

response.write(" ")


set rs=nothing

set conn=Nothing


%>

   <<Less

Re: type mismatch error - for Ajax

Posted By:   Anonymous  
Posted On:   Saturday, August 11, 2007 03:20 PM

Hi Jennifer

I know a good resource of solving these types of issues.
http://www.techhelpformarketers.com

Hope it's helpful to you!

[wilkin]

Re: type mismatch error - for Ajax

Posted By:   shameer_antony  
Posted On:   Wednesday, July 18, 2007 05:36 AM

mention whr exactly the error is




www.freshersonline.com

Job for Freshers

About | Sitemap | Contact