VB.NET + MS Access + .txt files = Please help :D
Author |
Message |
Thanos
|
Posted: Wed Jun 27, 2007 10:58 pm Post subject: VB.NET + MS Access + .txt files = Please help :D |
|
|
OK here's the situation:
A friend of mine is responsible for managing her company's cell phones (small company). The company has 10 employees that they pay the cell phone bills for. Every month the phone company sends the call information to my friend in a single table in an Access database.
But since the phone bills are paid under one business account, all the call information (for all 10 employees) is stored in one single database, and each CALL is listed row by row. So for example, the data looks something like this:
Employee Date of Call Phone Number Cost
-------- ------------ ------------ ----
Kelly 4/15/07 (123) 111-1111 $0.00
Kelly 4/15/07 (123) 111-1111 $0.00
Kelly 4/15/07 (123) 111-1111 $0.00
Steve 4/15/07 (123) 222-2222 $0.00
Steve 4/15/07 (123) 222-2222 $0.00
Steve 4/15/07 (123) 222-2222 $0.00
Mikey 4/15/07 (123) 333-3333 $0.00
Mikey 4/15/07 (123) 333-3333 $0.00
So for 10 employees who each make a few hundred calls a month...that's a lot data for one table!
She asked me if I could write an application to automate the following process:
1) divide the rows of call data according to employee name, and then export that information into a .txt file with their name on it. So that means Kelly, Steve, and Mikey would each have their own txt file with their call information
in it (maybe looks something like this: Kelly_Call_Data_April2007.txt). And,
2) Email the individual call data reports to the employees themselves.
So far, I know how to read the Access table data into VB.NET, and I know how to write data to txt files from VB.NET.
I guess my problem lies integrating these two steps, and actually getting each employees data into their own txt file with the correct file name.
Can anyone provide some insight as to what steps I'm missing? If my thinking/logic is incorrect, please point me in the right direction.
Any help would be greatly appreciated.
Thanks! |
|
|
|
|
|
Sponsor Sponsor
|
|
|
cool dude
|
Posted: Thu Jun 28, 2007 10:24 am Post subject: Re: VB.NET + MS Access + .txt files = Please help :D |
|
|
At first i thought this was a school assignment. lol. Anyways there are many solutions to this problem. Here's one logical solution that might work
1) get all the data from the access table and store it in vb
2) sort this data using a sorting algorithm according to the names. Thus pair up all the Kelly's together, all the Steve's together, etc.
3) make a loop that goes through the sorted list until it reaches a different name. for example
kelly
kelly
kelly
steve
steve
the loop will go from 1 to 3. but make an explicit loop (do until) and have a counter variable storing how many names you went through. now make a for loop that will go from 1 to count that will write all the kelly's to the file. and you can call this file whatever you like.
4) once you went through all the kelly's have an outer loop that will repeat the process until end of file (do until EOF(1))
I'm pretty sure this logic should work. If you have any questions please feel free to ask. Good Luck |
|
|
|
|
|
Thanos
|
Posted: Fri Jun 29, 2007 7:18 am Post subject: Re: VB.NET + MS Access + .txt files = Please help :D |
|
|
Thanks for the input. I will give it a shot. |
|
|
|
|
|
|
|