|
 |
asp_web_howto thread: Databases and white spaces
Message #1 by "Jonathan Marshall" <jdmarsh2g@h...> on Tue, 02 Jul 2002 18:36:59 +0000
|
|
<html><div style='background-color:'><DIV>during updating a database retrieving data
from that recordset sending the user to a form. </DIV>The user then from there will keep existing data or change the data for
each particular field.
<DIV></DIV>when the values are passed over to the update query. I only want to include the fields where data was entered
<DIV></DIV>my dilemna is that the database has some fields with white space in them causing my update sql query to bomb
out on me.
<DIV></DIV>if field1 <> "" THEN
<DIV></DIV>sql sql etc
<DIV></DIV>
<DIV></DIV>else if field2 <> "" THEN
<DIV></DIV>
<DIV></DIV>End if
<DIV></DIV>
<DIV></DIV>what is the best way to remedy this problem and prevent it from happening in the future
<DIV></DIV>thanks <BR>jonathan</div><br clear=all><hr>Join the world?s largest e-mail service
with MSN Hotmail. <a href='http://g.msn.com/1HM1ENUS/c157??PI=44364'>Click Here</a><br></html>
Message #2 by Mark Eckeard <meckeard2000@y...> on Tue, 2 Jul 2002 11:45:44 -0700 (PDT)
|
|
Trim the fields and check the length:
if len(trim(field1)) > 0 then
sql
end if
Mark
--- Jonathan Marshall <jdmarsh2g@h...> wrote:
<HR>
<html><div style='background-color:'><DIV>during
updating a database retrieving data from that
recordset sending the user to a form. </DIV>The user
then from there will keep existing data or change the
data for each particular field.
<DIV></DIV>when the values are passed over to the
update query. I only want to include the fields where
data was entered
<DIV></DIV>my dilemna is that the database has some
fields with white space in them causing my update sql
query to bomb out on me.
<DIV></DIV>if field1 <> "" THEN
<DIV></DIV>sql sql etc
<DIV></DIV>
<DIV></DIV>else if field2 <> "" THEN
<DIV></DIV>
<DIV></DIV>End if
<DIV></DIV>
<DIV></DIV>what is the best way to remedy this problem
and prevent it from happening in the future
<DIV></DIV>thanks <BR>jonathan</div><br
clear=all><hr>Join the world?s largest e-mail service
with MSN Hotmail. <a
href='http://g.msn.com/1HM1ENUS/c157??PI=44364'>Click
Here</a><br>
---
Improve your web design skills with these new books
from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
</html>
__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com
Message #3 by "Vincent Vandermeeren \(mailinglists Only\)" <vinnie@j...> on Tue, 2 Jul 2002 21:59:24 +0200
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_0019_01C22213.BA951290
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi Jonathan,
try to use the replace command
text=3Dreplace(text,"","-'")
this will work ...
greetings,
Vinnie
----- Original Message -----
From: Jonathan Marshall
To: ASP Web HowTo
Sent: Tuesday, July 02, 2002 8:36 PM
Subject: [asp_web_howto] Databases and white spaces
during updating a database retrieving data from that recordset sending
the user to a form.
The user then from there will keep existing data or change the data
for each particular field.
when the values are passed over to the update query. I only want to
include the fields where data was entered
my dilemna is that the database has some fields with white space in
them causing my update sql query to bomb out on me.
if field1 <> "" THEN
sql sql etc
else if field2 <> "" THEN
End if
what is the best way to remedy this problem and prevent it from
happening in the future
thanks
jonathan
-------------------------------------------------------------------------
-----
Join the world's largest e-mail service with MSN Hotmail. Click Here
--- Improve your web design skills with these new books from
Glasshaus. Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e r-20 Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e r-20 Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e r-20 --- Change your mail options at http://p2p.wrox.com/manager.asp
or
|
|
 |