CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2000
    Location
    Charlotte, North Carolina
    Posts
    3

    Using text file as input

    I need to know if there is a way to use a .txt or .doc file as input for a database. Often, clients send me information to update their location or contact information in an MS Word or .txt file. It is usually not typed up in sentence format (think addresses and such). Is there a way to do this through VB, and if so, how would you go about doing it? Any help would be greatly appreciated. Thanks.


  2. #2
    Join Date
    Sep 1999
    Location
    Red Wing, MN USA
    Posts
    312

    Re: Using text file as input

    If it's Field and Record Delimited, then you should have no problem using it as a DataSource, if using a DataControl, set the "Connect" property to "Text;" and the Database as the File path/Name, if ADO build a Connection string using a Text DSN to do the same thing. once this is doen you can treat the Data as a Recordset/Table:

    Note..
    Usually the First Record in the file is used as the Field Names, so you may need to insert a Line at the Beginning of the Text document.

    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]
    Certified AllExperts Expert: http://www.allexperts.com/displayExp...p?Expert=11884
    Aaron Young
    Senior Programmer Analyst (Red Wing Software)
    Certified AllExperts Expert

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured