Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 26th, 2004, 05:48 AM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default text file to access

Hi I have a text file from which i want to import data to

access, does anybody know how i can go about this or

where i can get information about this subject? thanks,

Treasa


Reply With Quote
  #2 (permalink)  
Old October 26th, 2004, 06:07 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Are you looking for asp code that would do that or wanted to know if this can be done from within ACCESS?

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
  #3 (permalink)  
Old October 26th, 2004, 06:22 AM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

no i needed to do this using asp, as i will need to show it to the user before it is saved to database. any ideas? thanks

Reply With Quote
  #4 (permalink)  
Old October 26th, 2004, 06:38 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Then take a look at this thread and look for my last post in there. Actually it doesn't contain the code for adding to database, it just has the code for reading from the CSV/txt file and splits that into columns, and got a comment where you got to add the code that writes it into database.

Importing from CSV File to SQL DB, Strange problem

Hope that should take you in the right direction. If at all you have any queries on issues with it, you can write here, we will try and help you.

Cheers!

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
  #5 (permalink)  
Old October 26th, 2004, 09:38 AM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a million for the help. The only problem is that my text file contains headings then a colon and then on the next line the data to be filled in or displayed.
ie:
Name:
Treasa
(blank line)
Address:
Limerick,
Ireland

I will need to be able to look for a colon and then take everything until i get blank space. Have you any ideas how to do this?
Thanks a million,
Treasa

Reply With Quote
  #6 (permalink)  
Old October 26th, 2004, 08:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

So, a record comprises just the Name and Address part right? If so, is there a blank line after Address part(Ireland) too? And how many lines of address there per record? As the sample posted here shows just 2 lines following the line with "Address:". Also let me know what is the structure of the table in access going to be?

Name, Address ???
OR
Name, Address1, Address2 ???

Cheers!

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
  #7 (permalink)  
Old October 27th, 2004, 04:36 AM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi there,
the file will actually be a long file. I will have to convert it from a text report and so it is much more complicated than just what i sent last time, i think what i will have to do now is search through the file, if the row is blank skip it and if not compare it to a word (the heading, ie date, name, location etc) and then save it as being that. have you any ideas how i will go about that?
thanks a lot!
Treasa

Reply With Quote
  #8 (permalink)  
Old October 27th, 2004, 05:41 AM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

sorry, what i meant to say was that i had to convert it from a word report, because you can't parse a word report with asp, if i'm correct. Then i will have to parse the text file. the only problem now is that when the report is converted to a text file it gets a bit jumbled up because it's in tables in the report, is there anyway i can get it to transfer across with certain boxes linked to others?

Reply With Quote
  #9 (permalink)  
Old October 27th, 2004, 06:30 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

It is tough to parse that using asp, when one is not sure about all the possibilities of data/format there. That is why I was asking you all that info. But the way you described it, I think it would be bit complicated, as it doesn't seem to be regularly/evenly distributed.

Only if we know what all headers are there and in what all possibilities the data is present, we could try and help on that. Just if we understood the text file data correctly, we can try command the asp script to parse it the was we want. Lets see what the best could be done.

Cheers!

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
  #10 (permalink)  
Old October 27th, 2004, 06:40 AM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yes the problem is that the person filling in the form may leave blank spaces in the form, and so it will be very hard to parse. I was thinking now though, that i could name the cells in the word form template, and then save it as an xml file, and then parse through the xml file and look for the tags. does anybody know if that is possible? i don't know if you have any experience with word?

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Link a text file to Access using VBA wscheiman Access VBA 1 June 30th, 2013 07:02 PM
A parsed text file to an Access table? josmith2 ADO.NET 0 May 10th, 2007 01:52 PM
A parsed text file to an Access table? josmith2 VB Databases Basics 0 May 8th, 2007 07:13 AM
parsing a text file to use in an Access 2003 app Irishtom Access VBA 12 February 6th, 2006 08:22 AM
Text File-Newbie VBA Access mbeirn Access VBA 1 October 6th, 2005 07:18 AM



All times are GMT -4. The time now is 07:44 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.