CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2012
    Posts
    6

    HELP! Connect to database & export text file content to microsoft access database

    Hi all,

    I need some help:
    1. How to connect to ms access?
    2. How to export the content of text file to ms access database?

    Now I already manage to read text file, just left other 2 steps. Anybody please help (provide me some example of codes if possible) because I really don't know how to do these.




    package textfiles;
    import java.io.IOException;

    public class Dictionary {
    public static void main(String[ ] args) throws IOException{

    String file_name = "C:/Users/King/Desktop/Table A.txt";

    try{
    ReadFile file = new ReadFile( file_name );
    String[ ] aryLines = file.OpenFile( );

    int i;
    for ( i=0; i < aryLines.length; i++ ) {
    System.out.println( aryLines[ i ] ) ;
    }
    }

    catch ( IOException e ) {
    System.out.println( e.getMessage() );
    }
    }
    }




    Here I attached my Table A text file & screen shot of my database table. Thanks!
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Join Date
    Feb 2010
    Posts
    121

    Re: HELP! Connect to database & export text file content to microsoft access database

    This should get you started on connecting to a MS Access DB


    http://www.codeproject.com/Articles/...ases-from-Java


    As for importing (not exporting) I can't help you there but really you should try and learn the basics first, i.e. create your MS Access DB first and be able to read, insert, delete rows and run queries before you attempt to import data in directly, which is the more complicated way to do 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
  •  





Click Here to Expand Forum to Full Width

Featured