Menu

getTable

beausangm
2007-01-31
2012-10-04
  • beausangm

    beausangm - 2007-01-31

    Hi,

    Hopefully a simple one,

    the following two lines of code work well in that they create test.mdb, and also create and populate table aaa.
    Database db = Database.create(new File("test.mdb"));
    Database.open(new File("test.mdb")).importFile("aaa", new File("aa.TXT"), "\t");

    My problem is I then need to retrieve the information from table aaa, on processing the next line x results in null.
    Table x = db.getTable("aaa");

    Is there a simple way of getting around this?

    Much Appreciated.

     
    • James Ahlborn

      James Ahlborn - 2007-01-31

      the problem is that you are using two different handles to the database. you open one on the first line and one on the second. change line 2 to:

      db.importFile("aaa", new File("aa.TXT"), "\t")

       
      • beausangm

        beausangm - 2007-01-31

        Thanks You!

        It works great.

         

Log in to post a comment.