merging data with text files


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 11 of 11

Thread: merging data with text files

  1. #1
    Join Date
    Aug 2004
    Posts
    43,023

    merging data with text files

    [Originally posted by hugh]

    I wish to merge a recordest from a sql database
    with a text file. I can do this in access with reports or with a word mailmerge but i wish to know the best way of going about replicating this in visual basic. Would using a product like crystal reports be any good or would i be better off writing the vb code to do the job for me.
    Thanx in advance.

  2. #2
    Join Date
    Aug 2004
    Posts
    43,023

    Re:merging data with text files

    [Originally posted by FreeVBCode.com]

    This is the type of question that causes debate among developers, but my opinion would be that it's generally best to write your own code for this type of task.

  3. #3
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:merging data with text files

    [Originally posted by hugh]

    Thanx a bunch for your reply.

    Are there any resources that you could recommend
    to me that deal with this issue ?

    I would appreciate it.

    cheers

  4. #4
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Re:merging data with text files

    [Originally posted by FreeVBCode.com]

    I'm not sure. Can you describe the problem a little more specifically and perhaps I can point you in the right direction.

  5. #5
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Re:Re:merging data with text files

    [Originally posted by hugh]

    Thanx a million for showing an interest. Well here goes.

    Its quite simple really. I have a recordset returned from a query
    from a SQL database. I want to merge the data in this
    recordset with a text file. Exactly like a mail merge
    or a report. This merge will then be saved as a text file.
    (well actually it wil be saved as a VRML file, which is a text
    file, so its the same thing)

    The text file will contain some VMRL code and its this i want
    to merge the data with. So i want to be able to create the
    same functionality as a mail merge without having to
    use microsoft word. I dont want people who will use this
    to need WORD to run the merge.

    That is essentially it.

    Again i appreciate your help.

    Cheers

  6. #6
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Re:Re:Re:merging data with text files

    [Originally posted by FreeVBCode.com]

    If the data from the text file is in a standard format, I don't see where the would be a problem writing VB string manipulation code to merge the recordset results with the file and saving the output to a new file.

  7. #7
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Re:Re:Re:Re:merging data with text files

    [Originally posted by hugh]

    Thanks for the reply.

    When this issue came up last week at he start of this project
    i figured that it was a simple enough problem.

    The data is standard text.

    However im new to VB and was looking for any good resources on
    using string manipulation in VB. Either in book form
    or on the web that you might recommend. Where would be
    a good place to start if i wanted to tackle this problem.

    Cheers.

    h

  8. #8
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Re:Re:Re:Re:Re:merging data with text files

    [Originally posted by serge dufour]

    i murge data from a text file into a acces database and i can assure you that there is code in here to help you out and give you a hint on where to start.

    if you want, i could give you some sample on how i did that...
    email me at sdufour@ddi.qc.ca if you need help


  9. #9
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Re:Re:Re:Re:Re:Re:merging data with text files

    [Originally posted by hugh]

    Many thanks Serge for your reply.

    I am indeed interested to hear of any suggestions or code examples that might help me to solve this issue.
    I am also currently looking at the possibility that i might use VB and MS word to merge the data automatically,
    however i would much prefer to use custom code written to read the record and merge it with the text, so that everything is contained within VB.

    I look foward to your reply.

    h

  10. #10
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Re:Re:Re:Re:Re:merging data with text files

    [Originally posted by FreeVBCode.com]

    I guess you should start by learning the different string manipulation functions. Besides the documentation, there are demonstrated at <A HREF = 'http://www.freevbcode.com/ShowCode.Asp?ID=2288'>http://www.freevbcode.com/ShowCode.Asp?ID=2288</A>.

  11. #11
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Re:Re:Re:Re:Re:Re:merging data with text files

    [Originally posted by hugh]

    looks good. Thanx for the help.
    Appreciate it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center