Connect to MS Access from C/C++/PHP

21. January 2013 11:51 by Mrojas in   //  Tags: , , , , , ,   //   Comments (0)

Again Access... hey Access was a great database.

So if you are using access and you are thinking in how to use it from PHP or from a C/C++ app then you should check 

mdbtools

Does it work on iOS, well there is a discussion about at (http://old.nabble.com/Port-libmdb-(mdb-tools)-for-iOS-td34282658.html)  but I think there might be some licensing issues.

If that is the case I would recommend writting your own version of mdbtools, Take a look at https://github.com/brianb/mdbtools/blob/master/HACKING for detail info about the file format.

Connect to MS Access from C/C++/PHP

21. January 2013 11:51 by Mrojas in   //  Tags: , , , , , ,   //   Comments (0)

Again Access... hey Access was a great database.

So if you are using access and you are thinking in how to use it from PHP or from a C/C++ app then you should check 

mdbtools

Does it work on iOS, well there is a discussion about at (http://old.nabble.com/Port-libmdb-(mdb-tools)-for-iOS-td34282658.html)  but I think there might be some licensing issues.

If that is the case I would recommend writting your own version of mdbtools, Take a look at https://github.com/brianb/mdbtools/blob/master/HACKING for detail info about the file format.

Connect to MS Access from Java

21. January 2013 11:13 by Mrojas in   //  Tags: , , , , ,   //   Comments (0)

This is not an scenario that I commonly find, but now with Android and with the spread of Linux base environments an devices you are just don't want to be limited to just one technology.

So I found this library which I found extremely useful and I can recommend: Jackcess

 

The following are some code samples from the Jackcess library

  • Displaying the contents of a table:
    System.out.println(Database.open(new File("my.mdb")).getTable("MyTable").display());
    
  • Iterating through the rows of a table:
    Table table = Database.open(new File("my.mdb")).getTable("MyTable");
    for(Map<String, Object> row : table) {
      System.out.println("Column 'a' has value: " + row.get("a"));
    }
    
  • Searching for a row with a specific column value:
    Map<String, Object> row = Cursor.findRow(table, Collections.singletonMap("a", "foo"));
    if(row != null) {
      System.out.println("Found row where 'a' == 'foo': " + row);
    } else {
      System.out.println("Could not find row where 'a' == 'foo'");
    }
    
  • Creating a new table and writing data into it:
    Database db = Database.create(new File("new.mdb"));
    Table newTable = new TableBuilder("NewTable")
      .addColumn(new ColumnBuilder("a")
                 .setSQLType(Types.INTEGER)
                 .toColumn())
      .addColumn(new ColumnBuilder("b")
                 .setSQLType(Types.VARCHAR)
                 .toColumn())
      .toTable(db);
    newTable.addRow(1, "foo");
    
  • Copying the contents of a JDBC ResultSet (e.g. from an external database) into a new table:
    Database.open(new File("my.mdb")).copyTable("Imported", resultSet);
  • Copying the contents of a CSV file into a new table:
    Database.open(new File("my.mdb")).importFile("Imported2", new File("my.csv"), ",");

Remember that if you want to use it android you use some tweaks:

"The following steps will make Jackcess compatible with the Android platform.

  • Set the system property "com.healthmarketscience.jackcess.brokenNio=true"
  • Set the system property "com.healthmarketscience.jackcess.resourcePath=/res/raw/"
  • Copy the *.txt, *.mdb, and *.accdb files from the "com/healthmarketscience/jackcess/" directory in the Jackcess jar to the "/res/raw" Android application directory.
  • Before executing any Jackcess code, set the current Thread's context classloader, e.g. "Thread.currentThread().setContextClassLoader(Database.class.getClassLoader())"."

The Mango is close!!!

24. May 2011 03:04 by Mrojas in General  //  Tags: , , , , , ,   //   Comments (0)

Jejeje. Well if you are a phone developer, either an iOS guy who is thinking on offering
his/her apps in the MS Marketplace or just someone with a great interest in Windows Phone
then you should know what mango is.

Mango is a new update for the Windows Phone, and it will mean a lot for developers,
because if you already liked WP7 you will love MANGO.

 

VIDEO LINK 

 

Mango means HTML5 yes!
Mango means Multitasking!
Mango means Hands-free messaging, did you ever
wanted to send SMS without using your fingers, now you can!

I don’t think is mentioned in this video but Mango is also SQLCE a great alternative
for Android and iPhone developers who were using sqllite.

Categories