10-25-2000, 11:20 PM
I have a newbie question for you all. It should be fairly easy, but I can't figure it out.
I'm using VB6, and I'm just trying to load a comma delimited file into my VB app. There is about 270 records, with 6 elements in each record.
I would like the program to just open the file, read it in, and display that data in text boxes in my form. I don't want to write anything additional to this data file at all. Just read it in...
Can anyone help?
10-26-2000, 02:22 AM
Okay... I made it easy on myself. I just converted my comma delimited text file to an Access Database. :)
All the fields came over just great, and all is well... Almost. (I *love* VB... But it still is light years better than VC++!!)
Another newbie question....
I want to add Carriage Return/Line Feeds to a multiline datafield, that is being displayed in a text box.
I would like the display to look like this...
Mary had a little lamb
her fleece as white as snow
and everywhere Mary went
the lamb was sure to go
And not like this... (What I'm currently getting)
Mary had a little lamb her fleece as white as snow and everywhere Mary went the lamb was sure to go
How can I fix this? Can I add carriage returns to my data? Is this a problem better addressed through Access?
10-26-2000, 12:20 PM
You can use the 'vbCrLf' constant for a carraige return/line feed like so:
"Mary had a little lamb" & vbCrLf & "her fleece as white as snow" & vbCrLf & "and everywhere Mary went" & vbCrLf & "the lamb was sure to go"
PS - If you're displaying this in a TextBox be sure to set its 'Multiline' property to True.
10-26-2000, 12:36 PM
Is the text of the textbox one database field or multiple fields?
if it's multiple fields you just put the return character between each field. For example
text1.text= field1+ vbCrLf+ field2
For a single feild I'm not really sure. You could put a comma for each line return in the database then replace the comma with a line return.