Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 7th, 2004, 02:41 PM
Authorized User
 
Join Date: Dec 2003
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default Remove Hard Returns from Memo Field


Hello, and thanks for giving this a look...

Say, I have a field in a database, that must allow users to enter hard returns in it. But I also need to export from that db a tab-delimited file, that cannot have hard returns in it.

Is there a vb function that can replace or remove hard returns from a string or memo field?

Thanks!!!

Darin



 
Old July 7th, 2004, 02:46 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:I also need to export from that db a tab-delimited file, that cannot have hard returns in it.
May I now why is it so that, it cannot have hard returns in it?

Also please avoid Cross posting the same in different threads.
_________________________
- Vijay G
Strive for Perfection
 
Old July 7th, 2004, 03:08 PM
Authorized User
 
Join Date: Dec 2003
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Vijay, thanks for your interest,

I can't have hard returns because there is an error checking function that the people I'm sending the export to have written in. Their import will fail if the top line of my export does not have a number that matches the number of lines following it. The hard returns create extra lines that aren't represented in the the number, because the number is a count of all of the records exported.

So for my export to work with their import, I must remove all of the hard returns, but am unsure as to how that can be accomplished.

Concerning Cross-Posting:
I didn't throw this post up in a bunch of forums that don't apply. Rather, I placed this post in the two forums that it made sense to post this question in. ('ASP->ASP Databases' and 'Database->Access ASP') The two forums exist, and my posting, I think, applies to both, since my question involves all elements concerned in both forums. It seems like the forums are just as redundant as the postings, though since both forums exist, posting in both can help me find the answer that I (and other people may be) looking for faster. And of course I'd post whatever solution applied to both myself. I realize the trouble cross-posting could cause, but in some cases, I think it just makes sense - I'd be happy to reneg on this though too, if there were some very clear reason that it was harming the process.

Concerning my post...
Thanks for your interest in why I need to accomplish this, do you have any suggestions as to how I can remove the hard returns?

Best,

Darin
 
Old July 7th, 2004, 03:53 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

There is a VB function named REPLACE().

Syntax - Replace(STRING, SEARCH_STRING, REPLACE_STRING)

Code:
Replace(MyString, vbCRLF, "") 'should suit your need
Also you can try using the following, if you are unsure about CARRIAGE RETURN / LINE FEED values. You can use any of these mentioned here that suits your requirement.
Code:
Replace(MyString, chr(13), "")
or
Code:
Replace(MyString, chr(10), "")
Concerning Cross-Posting: If I were you, I would post this under 'Access ASP', as I assume this is related with ACCESS database and looking for a VB function(ASP/VBSCRIPT) which seems to be the closest match. IMO 'ASP Databases' seems generic where ASP can be used with any kind of databases(mysql, sql server or any). I won't say there are redundant forums, as I could see difference among them. The only reason I wanted you not to cross post is to not confuse the readers of the post and yourself if that was closed/unattended. Also when searching for such threads in future, it should not mislead one to the post that was not actually closed/unfinished.

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old July 7th, 2004, 04:08 PM
Authorized User
 
Join Date: Dec 2003
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default


Hi Vijay,

Many many thank-yous for the perfect solution...

Concerning Cross-Posting:
Your point is definately taken.

Best,

Darin









Similar Threads
Thread Thread Starter Forum Replies Last Post
Memo Field Brendan Bartley Access 11 December 13th, 2007 04:28 PM
remove returns redruff Classic ASP Basics 13 January 9th, 2007 11:56 PM
Memo field not displaying meichmann SQL Server ASP 3 August 31st, 2006 11:36 AM
MEMO FIELD! With VB6 rolandatem Pro VB Databases 2 January 28th, 2005 10:49 PM
Pagefault from memo field dave_pollak Access VBA 0 November 24th, 2004 10:25 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.