Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: RE: SQL Server 7 - Strings in column


Message #1 by "James Garrett" <jhgarrett@e...> on Wed, 6 Mar 2002 18:18:20 -0500
Bingo! Thank you Peter Foti.



Thank you all for your responses.



James





----- Original Message -----

From: "Peter Foti (PeterF)" <PeterF@S...>

To: "ASP Databases" <asp_databases@p...>

Sent: Wednesday, March 06, 2002 12:54 PM

Subject: [asp_databases] RE: SQL Server 7 - Strings in column





> Are you attempting to display the text in a text box?  If so, then the

> problem has to do with missing quotes around the value attribute.  For

> example:

>

> <input type="text" value=<%= oRS("MyText") %> name="mytextbox">

>

> Make sure value has quotes surrounding it, and also make sure you

> HTMLEncode the string.  For example:

>

> <input type="text" value="<%= Server.HTMLEncode( oRS("MyText") )%>"

> name="mytextbox">

>

>

> If this is not your problem, and you are simply trying to print the

> output, then I without seeing your code, I don't know what the problem

> could be.

> Regards,

> Pete

>

> > -----Original Message-----

> > From: James Garrett [mailto:jhgarrett@e...]

> > Sent: Wednesday, March 06, 2002 11:08 AM

> > To: ASP Databases

> > Subject: [asp_databases] SQL Server 7 - Strings in column

> >

> >

> > I strings in a database column. Such as, "This is a problem.". When I

> > attempt to display the data via ASP/ADO to the browser, I get "This".

> > I changed the string to "Thisisaproblem." and got "Thisisaproblem." .

> >

> > What cause this in a SQL Server 7 data column?  What must I change?

> >

> > James

> >

> >




> > $subst('Email.Unsub').

> >

>




$subst('Email.Unsub').



Message #2 by "Drew, Ron" <RDrew@B...> on Wed, 6 Mar 2002 13:32:21 -0500



-----Original Message-----

From: Drew, Ron

Sent: Wednesday, March 06, 2002 1:14 PM

To: ASP Databases

Subject: [asp_databases] RE: SQL Server 7 - Strings in column





Sorry, I put 3 spaces instead of one on my last reply,

Dim form_appcode

form_appcode=3Drstemp("appcode")



This example replaces spaces with one space.

If form_appcode <> "" Then

form_appcode =3D Replace(form_appcode, " ", "&nbsp;")

End If



This example replaces all tabs with three spaces.

If form_appcode <> "" Then

form_appcode =3D Replace(form_appcode, vbTAB, "&nbsp;&nbsp;&nbsp;")

End If



This example replaces all line breaks with html break.

If form_appcode <> "" Then

 form_appcode=3DReplace(form_appcode, vbCRLF, "<BR>")

End If









-----Original Message-----

From: James Garrett [mailto:jhgarrett@e...]

Sent: Wednesday, March 06, 2002 11:08 AM

To: ASP Databases

Subject: [asp_databases] SQL Server 7 - Strings in column





I strings in a database column. Such as, "This is a problem.". When I

attempt to display the data via ASP/ADO to the browser, I get "This". I

changed the string to "Thisisaproblem." and got "Thisisaproblem." .



What cause this in a SQL Server 7 data column?  What must I change?



James








$subst('Email.Unsub').






$subst('Email.Unsub').

Message #3 by "Drew, Ron" <RDrew@B...> on Wed, 6 Mar 2002 13:13:37 -0500
Dim form_appcode

form_appcode=3Drstemp("appcode")



This example replaces spaces with one space.

If form_appcode <> "" Then

form_appcode =3D Replace(form_appcode, " ", "&nbsp;&nbsp;&nbsp;")

End If



This example replaces all tabs with three spaces.

If form_appcode <> "" Then

form_appcode =3D Replace(form_appcode, vbTAB, "&nbsp;&nbsp;&nbsp;")

End If



This example replaces all line breaks with html break.

If form_appcode <> "" Then

 form_appcode=3DReplace(form_appcode, vbCRLF, "<BR>")

End If









-----Original Message-----

From: James Garrett [mailto:jhgarrett@e...]

Sent: Wednesday, March 06, 2002 11:08 AM

To: ASP Databases

Subject: [asp_databases] SQL Server 7 - Strings in column





I strings in a database column. Such as, "This is a problem.". When I

attempt to display the data via ASP/ADO to the browser, I get "This". I

changed the string to "Thisisaproblem." and got "Thisisaproblem." .



What cause this in a SQL Server 7 data column?  What must I change?



James








$subst('Email.Unsub').

Message #4 by "Peter Foti (PeterF)" <PeterF@S...> on Wed, 6 Mar 2002 12:54:48 -0500
Are you attempting to display the text in a text box?  If so, then the

problem has to do with missing quotes around the value attribute.  For

example:



<input type="text" value=<%= oRS("MyText") %> name="mytextbox">



Make sure value has quotes surrounding it, and also make sure you

HTMLEncode the string.  For example:



<input type="text" value="<%= Server.HTMLEncode( oRS("MyText") )%>"

name="mytextbox">





If this is not your problem, and you are simply trying to print the

output, then I without seeing your code, I don't know what the problem

could be.

Regards,

Pete



> -----Original Message-----

> From: James Garrett [mailto:jhgarrett@e...]

> Sent: Wednesday, March 06, 2002 11:08 AM

> To: ASP Databases

> Subject: [asp_databases] SQL Server 7 - Strings in column

> 

> 

> I strings in a database column. Such as, "This is a problem.". When I

> attempt to display the data via ASP/ADO to the browser, I get "This".

> I changed the string to "Thisisaproblem." and got "Thisisaproblem." .

> 

> What cause this in a SQL Server 7 data column?  What must I change?

> 

> James

> 

> 




> $subst('Email.Unsub').

> 

Message #5 by "Meinken, Joe" <Joe.Meinken@q...> on Wed, 6 Mar 2002 11:39:36 -0600
Include your code.



-----Original Message-----

From: James Garrett [mailto:jhgarrett@e...]

Sent: Wednesday, March 06, 2002 10:08 AM

To: ASP Databases

Subject: [asp_databases] SQL Server 7 - Strings in column





I strings in a database column. Such as, "This is a problem.". When I

attempt to display the data via ASP/ADO to the browser, I get "This".

I changed the string to "Thisisaproblem." and got "Thisisaproblem." .



What cause this in a SQL Server 7 data column?  What must I change?



James








$subst('Email.Unsub').

Message #6 by "Phil Sayers" <philipsayers@m...> on Wed, 6 Mar 2002 12:45:46 -0500

I've only seen this if you try to display the text in a form field but

do not setup the tag properly.



If you do it using Response.Write the BAD way is



Response.Write "<input type=""text"" value=" & Rs("fieldname") & ">"



In IE the text will be terminated at the first space in the string, and

the IE will "correct" your HTML and close the input tag for you.  The

correct way is to add two extra quotes for the value attribute so you

have



Response.Write "<input type=""text"" value=""" & Rs("fieldname") & """>"





-----Original Message-----

From: James Garrett [mailto:jhgarrett@e...] 

Sent: Wednesday, March 06, 2002 11:08 AM

To: ASP Databases

Subject: [asp_databases] SQL Server 7 - Strings in column



I strings in a database column. Such as, "This is a problem.". When I

attempt to display the data via ASP/ADO to the browser, I get "This".

I changed the string to "Thisisaproblem." and got "Thisisaproblem." .



What cause this in a SQL Server 7 data column?  What must I change?



James








$subst('Email.Unsub').



Message #7 by "James Garrett" <jhgarrett@e...> on Wed, 6 Mar 2002 11:08:14 -0500
I strings in a database column. Such as, "This is a problem.". When I

attempt to display the data via ASP/ADO to the browser, I get "This".

I changed the string to "Thisisaproblem." and got "Thisisaproblem." .



What cause this in a SQL Server 7 data column?  What must I change?



James




  Return to Index