Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > csv trouble !


Reply
 
Thread Tools Display Modes
  #1  
Old 03-30-2004, 01:47 AM
davieboy_xr davieboy_xr is offline
Centurion
 
Join Date: Nov 2003
Location: uk
Posts: 174
Default csv trouble !


I have a .csv file which i use to import into a database.Some of the csv values have number values but mostly text. My problem is that when retrieving the records within the database i have Speech marks around the text.This is what the .csv file looks like:

23 , "hello" , "This" , "is" , "some" , "text", 12


No problems with the actual import of the data, but it does look horrible when when displaying on a form. Is there anyway i remove these speech marks, and would this be done after using the split() function.
Help much appriciated. thanks dave
Reply With Quote
  #2  
Old 03-30-2004, 01:53 AM
HunterVF01's Avatar
HunterVF01 HunterVF01 is offline
Contributor
 
Join Date: Apr 2003
Location: Home Planet... Earth
Posts: 441
Default

You may want to do a Replace before the Split.

Reply With Quote
  #3  
Old 03-30-2004, 02:04 AM
davieboy_xr davieboy_xr is offline
Centurion
 
Join Date: Nov 2003
Location: uk
Posts: 174
Default

Bit lost now...... here`s wht i do with the csv file

Code:
line input #1, strL strF = split(strL, ",") rs.addnew rs!firstfield = strF(0) if rs!firstfield <= "" then rs!firstfield = "No record" end if

so would i have to pass strL through replace, but how would i get it to recognise where the quotes are?
Reply With Quote
  #4  
Old 03-30-2004, 02:12 AM
HunterVF01's Avatar
HunterVF01 HunterVF01 is offline
Contributor
 
Join Date: Apr 2003
Location: Home Planet... Earth
Posts: 441
Default

Try this..
Code:
... Line Input #1, strL strL = Replace(strL, """, "") strF = split(strL, ",") rs.addnew ...

Reply With Quote
  #5  
Old 03-30-2004, 02:15 AM
davieboy_xr davieboy_xr is offline
Centurion
 
Join Date: Nov 2003
Location: uk
Posts: 174
Default

thanks works a treat ..cheers for your time
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble presenting report using CR mikechan8888 Database and Reporting 2 09-26-2003 10:59 AM
having trouble query Access with VBA apple80 Word, PowerPoint, Outlook, and Other Office Products 1 08-04-2003 08:24 PM
Trouble with Crystal Reports cyates Database and Reporting 5 08-04-2003 11:34 AM
menu trouble geek General 4 06-09-2003 04:44 AM
SQL query trouble TorreyKite Database and Reporting 3 03-25-2003 06:54 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->