[ic] Carriage returns entered in a field corrupt data in table

Ed LaFrance interchange-users@icdevgroup.org
Tue Sep 10 16:49:01 2002


At 11:46 AM 09/10/2002 -0700, you wrote:
>At 07:10 PM 9/9/2002 -0700, you wrote:
> >Hello,
> >
> >I am running IC4.8.5 using default db and have a memo
> >field in a table which people can write to, like a
> >guestbook. People want to be able to use carriage
> >returns so their info will display with paragraph
> >breaks, etc., however, when I download the table to
>my
> >local computer and import it into MS Access, the data
> >is corrupt, of course, from all the CR's.
> >
> >Does anybody have any recomendations on how I should
> >deal with this? What have others done? What
> >information should I be looking for when searching
> >archives? I've searched several times without finding
> >any info on this.
> >
> >TIA
> >
> >SKR
>
>My first suggestion would be: don't use Access ;-).
>But since that advice
>is unlikely to be taken, the thing I usually do is
>strip the CR's or better
>yet, replace them with <br> tags, which gives you the
>formatting the person
>had in mind when you display the data later. Take a
>look at the text2html
>filter:
>
>http://www.icdevgroup.org/cgi-bin/ic/docfly.html?mv_arg=ictags04.28
>______________________
>
>Thank you Ed! In trying to store my data without
>carriage returns and replacing them with <br>, I got
>it to filter when adding data to the field from the
>admin, changing the meta of my 'notes' field to filter
>with ' Simple text2html'. However, when trying to use
>it with a 'text area' on a IC page, these examples
>from the docs do not filter, and no errors reported:
>
><textarea name="notes" rows="20" cols="40"
>filter="name text2html">[value notes]</textarea>
>
><textarea name="notes" rows="20" cols="40"
>filter="text2html">[value notes]</textarea>
>
><textarea name="notes" rows="20" cols="40">[value
>notes filter="name text2html"]</textarea>
>
><textarea name="notes" rows="20" cols="40">[value
>notes filter="text2html"]</textarea>
>
><textarea name="notes" rows="20" cols="40">[filter
>op="name text2html"][value notes][/filter]</textarea>
>
>[filter op="name text2html"][<textarea name="notes"
>rows="20" cols="40">value notes]</textarea>[/filter]
>
>Any other ideas to make this textarea filter?

I was thinking more that you would pass the data through the filter when 
the customer submits it, before writing it to disk. How you would do this 
depends upon how you are doing the write; if you are using import:

[import table=tablename type=LINE continue=NOTES]
         notes: [value filter=text2html name=notes]
[/import]

If you are using mv_todo=set (direct write from the form), you would want 
to use an mv_click filter the submitted data:

<input type=hidden name=mv_click value=filter_notes>

[set filter_notes]
[calc]
         $CGI->{notes} = $Tag->filter( {}, $CGI->{notes} );
         return;
[/calc]
[/set]

There is probably a better way to do that last one; it seems I remember a 
recently added special variable which you can set on a form to tell IC to 
apply filters to various form vars automatically, but I don't have this 
info at my fingertips.

There are other issues - for instance, you may/need want to do the opposite 
conversion (change <p> and <br> back to newlines) when subsequently editing 
this data, if you offer that feature, and if you are using a form profile, 
you would not want to do the text2html filtering until all checks passed 
successfully. But this should get you started.

- Ed L.



>Will using an sql table contain the data within the
>field so I can import it into MS Access?
>
>Thanks again!
>
>SKR
>
>
>__________________________________________________
>Yahoo! - We Remember
>9-11: A tribute to the more than 3,000 lives lost
>http://dir.remember.yahoo.com/tribute
>_______________________________________________
>interchange-users mailing list
>interchange-users@icdevgroup.org
>http://www.icdevgroup.org/mailman/listinfo/interchange-users

===============================================================
Increase profits from your Interchange store...
http://www.newmediaems.com/cgi-bin/nm/software_fus.html
===============================================================
New Media E.M.S.               Software Solutions for Business
463 Main St., Suite D          eCommerce | Consulting | Hosting
Placerville, CA  95667         edl@newmediaems.com
(530) 622-9421                 http://www.newmediaems.com
(866) 519-4680 Toll-Free       (530) 622-9426 Fax
===============================================================