473,395 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

database new line problem

Hi, I've got a table with a column which is frequently used to store paragraphs, some with new lines in between. for example


a aaaaa aa aaaaaaa.
bbb bb.
cc ccccccccccccc.

I'd like to filter these results in vb, so that the new lines (or whatever it is seperating the lines) is removed, making it so that i can instead have a cell, or a representation of a cell on a page as one long string, spaces and full stops still included.

e.g

a aaaaa aa aaaaaaa.bbb bb. cc ccccccccccccc.


does anyone have an idea of how to do this, without changing the actual database formatting.

i use a piece of code to remove commas -

Dim strcomments() As String
Dim comments As String = ""
strcomments = array(29, n).ToString.Split(",")
comments = String.Join("", strcomments)

would it be possible to do this with this code, only instead of removing a ' , ' remove the new lines generated by someone copying and pasting paragraphs into a cell.
Dec 11 '07 #1
5 2127
jamesd0142
469 256MB
Quick option, possibly select all rows from the table, into strings, and say

str = string1 + string2

???
Dec 11 '07 #2
Quick option, possibly select all rows from the table, into strings, and say

str = string1 + string2

???
most cells in the database are multiline (strings spanning more than one new) and are unique to a row. so that wouldnt be possible :-(
Dec 11 '07 #3
jamesd0142
469 256MB
Well see if this helps,

Expand|Select|Wrap|Line Numbers
  1. DECLARE @a varchar(8000)
  2. SELECT @a=COALESCE(@a, '') + col01 + space(1) FROM (SELECT distinct (col01) from Dataset_Rows) as a
  3. SELECT rtrim(ltrim(@a)) AS [MyValues]
  4.  
it allows you to select all results in a single row.

result = col01 col02 col03...

----------------- OR --------------------

If i understand you correctly...

Can't you get the data into vb as it stands then use the mid/substring methods to cut it apart?
Dec 11 '07 #4
hi thanks for the reply, it would be easier for me to use the 'mid/substring' methods you are talking about, how does this work, i've only used splits on strings before.


thanks
Dec 11 '07 #5
jamesd0142
469 256MB
The mid function is simple:

Expand|Select|Wrap|Line Numbers
  1. dim a as string
  2. a = mid(str, startpossition, length)
  3.  
So if you have:

string Text = "abcdef"

you could pick out "cde" like this:

Expand|Select|Wrap|Line Numbers
  1. dim a as string
  2. a = mid(Text,3,3)
  3.  
Now you can also say:
Expand|Select|Wrap|Line Numbers
  1. dim a as string
  2. a = mid(Text,3,len(text)-2)
  3.  
so you could go from possition 3 to the end of the string etc.
len(text) = (length of text string) which is 6 characters in length.

this help at all?
Dec 11 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: democratix | last post by:
Hi, I've only got a couple years experience developing for Access but have recently been experimenting with HTML/javascript for gui and client-side scripting, mysql for database and php for...
5
by: lkrubner | last post by:
I have a webserver through Rackspace. I create a domain. I create an FTP user. I upload some files. I create a database called testOfSetupScript and then I create a database user named setup. I...
9
by: Earl Partridge | last post by:
Windows XP, Frontpage 2000, IIS 5.1, Access 2000 When I attempt to open a connection to my database I get an error the page cannot be found... this on my local machine, using localhost. The page...
0
by: clintonG | last post by:
I applied aspnet_regsql to SQL2K which was working fine throughout Beta 2 development. After installing Visual Studio and SQL Express RTM my application has blown up. Logging in to the application...
15
by: philip | last post by:
On a form, I have a datagridview. This datagridview is constructed on a dataset filled by a tableadapter. The table adapter do very well what it must do when filling dataset. Insertions,...
9
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web...
12
by: Steve | last post by:
I have a database that raises an error when you try to open it and it doesn't open. Trying to open the database with the OpenDatabase method raises the same error. Trying to import any objects...
12
by: kers | last post by:
Hello, New here. Have been searching this forum for a couple of hours now ( i am not kddin).... Havnt been able to find the solution to my problem. I have a access database. Split front and...
12
by: grace | last post by:
i am wondering why my database retrieval becomes too slow...we set up a new server (ubuntu, breezy badger) machine where we transferred all our files from the old server.. Our new server uses Asus...
39
by: alex | last post by:
I've converted a latin1 database I have to utf8. The process has been: # mysqldump -u root -p --default-character-set=latin1 -c --insert-ignore --skip-set-charset mydb mydb.sql # iconv -f...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.