Forums

This topic is locked

clear form insert

Posted 01 Mar 2001 12:15:20
1
has voted
01 Mar 2001 12:15:20 Michael Guntenaar posted:
Hi,

I got an problem ,

Does anybody know why an form field (with no carachters) inserts blanc caracters in my SQL database.

This is very important for my website beceause on my detail page I dont want to use space I dont need (conditional extension)

but now this extension always sees data in the fields

hope somebody can help me



Replies

Replied 06 Mar 2001 16:24:32
06 Mar 2001 16:24:32 Michael Guntenaar replied:
I don't know if anybody will read this topic anymore but I have found the solution. <img src=icon_smile_approve.gif border=0 align=middle>

I was using msSQL server 2000 all my field types where "char" wich standard had a &lt;null&gt; value.

Now I wanted to insert records through an ASp form but didnt want to fill in all the textboxes (not all required). So I could filter in my frontend (conditional region.)

But when you shoot a text field with no data, there appears to be a blank string of data in you database your database sees that and because its an char field it will put in spaces (a char field reserves the maximum of space in your record to save time while working).

I have changed all my fields to varchar and no problems no more.

So for everybody who had this problem this is the way to solve it "change the field to varchar" <img src=icon_smile_dead.gif border=0 align=middle>



Edited by - mguntenaar on 03/06/2001 16:26:12

Reply to this topic