Nov 3rd, 2000, 07:28 AM
Hi, I was wondering if someone has written a routine that helps me write data to and get data from my SQL Server database, so that it won't give an error. Hmm.. that was not very clear. Let me clarify myself using an example:
My home town is called 's-Hertogenbosch. When I want to write this as a string to the database, I first have to replace the leading ' by a double ' so that in the database, the field is filled with the value 's-Hertogenbosch. So far, so good.
Now I want to retrieve the data from the database and show it in a textbox, and it shows me an empty textbox, since the leading ' causes it to think the string is over. Here's the code:
<%
if blnAmILoggedIn then
response.write("<input type='text' name='City' size='30' value='" & RS_MYDATA.fields.item("City").value & "'>")
else
response.write("<input type='text' name='City' size='30'>")
end if
%>
In this code, if I get 's-Hertogenbosch from the database, it won't work. Does anyone know how I can easily check/convert all values that I get from the database, so it will display the correct string? I know what to do to get 's-Hertogenbosch into the database, just not how I can show it properly once I have retrieved it again.
Any help is more than welcome. Thanx! :)
My home town is called 's-Hertogenbosch. When I want to write this as a string to the database, I first have to replace the leading ' by a double ' so that in the database, the field is filled with the value 's-Hertogenbosch. So far, so good.
Now I want to retrieve the data from the database and show it in a textbox, and it shows me an empty textbox, since the leading ' causes it to think the string is over. Here's the code:
<%
if blnAmILoggedIn then
response.write("<input type='text' name='City' size='30' value='" & RS_MYDATA.fields.item("City").value & "'>")
else
response.write("<input type='text' name='City' size='30'>")
end if
%>
In this code, if I get 's-Hertogenbosch from the database, it won't work. Does anyone know how I can easily check/convert all values that I get from the database, so it will display the correct string? I know what to do to get 's-Hertogenbosch into the database, just not how I can show it properly once I have retrieved it again.
Any help is more than welcome. Thanx! :)