Hello
I have something very strange going on...
I get some info from a sql server database via remote scripting in javascript. Here is the code for the function in my remote scripting page:
Here's the code where the function is used
The data is allright, except when there is a single quote in the fields 'Dutch' or 'French'. Somehow it always gets converted into double quotes, where I would like to convert them myself to 2 single quotes.
The statement
changes the single quote into one double quote and one single quote.
How is that possible, and what can I do about it?
Greetz
VBMim
I have something very strange going on...
I get some info from a sql server database via remote scripting in javascript. Here is the code for the function in my remote scripting page:
Code:
function GetDescr(ArtNo)
{
conn = Server.CreateObject("ADODB.Connection");
conn.ConnectionTimeout = Application("C_ConnectionTimeout")
conn.CommandTimeout = Application("C_CommandTimeout")
conn.Open(Application("C_ConnectionString"), Application("C_RuntimeUserName"), Application("C_RuntimePassword"));
var rsDescr=conn.execute("select Dutch, French from PData where Art='" + ArtNo + "'")
var Descr;
if (rsDescr.eof == false)
{
Ned = rsDescr("Dutch").value;
Fra = rsDescr("French").value;
}
else
{Ned= "empty";
Fra= "empty";
}
Descr= {Ned:Ned,Fra:Fra};
return Descr;
}
Here's the code where the function is used
Code:
rsFunc = RSGetASPObject("rsInputFunctions.ASP");
Descrip = rsFunc.GetDescr(form2.Art.value).return_value;
document.getElementById("DescrD").value = Descrip.Ned;
document.getElementById("DescrF").value = Descrip.Fra;
The data is allright, except when there is a single quote in the fields 'Dutch' or 'French'. Somehow it always gets converted into double quotes, where I would like to convert them myself to 2 single quotes.
The statement
Code:
Ned = rsDescr("Dutch").value.replace("'","''")
How is that possible, and what can I do about it?
Greetz
VBMim