 |
| 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
|
|
|
|

October 26th, 2004, 05:48 AM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

October 26th, 2004, 06:07 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|
|

October 26th, 2004, 06:22 AM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

October 26th, 2004, 06:38 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|
|

October 26th, 2004, 09:38 AM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

October 26th, 2004, 08:14 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|
|

October 27th, 2004, 04:36 AM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

October 27th, 2004, 05:41 AM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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?
|
|

October 27th, 2004, 06:30 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|
|

October 27th, 2004, 06:40 AM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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?
|
|
 |