You still can access the database if you have the root access through shell commands :
Example :
mycomp$ adb shell
$ su
# cd com.android.providers.media
# ls
cache
databases
lib
shared_prefs
# cd databases
# ls
external.db
external.db-shm
external.db-wal
internal.db
internal.db-shm
internal.db-wal
# sqlite3 external.db
SQLite version 3.7.11 2012-03-20 11:35:50
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> select count(*) from images;
10
sqlite>
The tool used is sqlite3 which is a client command to an sqlite database. The database files are usually located in /data/data/com.someapp/databases/.
Edit : Wait... I was re reading your question. Do you mean you want to access a database of another app from your own app?
Edit : If you want to access another database, the other database has to be a content provider. The best example of that is the media library (the image table above is the table that content the picture in your device). Code sample :
// which image properties are we querying
String[] projection = new String[] { BaseColumns._ID, ImageColumns.BUCKET_DISPLAY_NAME, ImageColumns.DATE_TAKEN, MediaColumns.TITLE, MediaColumns.DATA };
// Get the base URI for the image table in the Contacts content provider.
Uri images = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
// Make the query.
Cursor cur = context.managedQuery(images, projection, // Which columns to return
"", // Which rows to return (all rows)
null,//selection, // Selection arguments (none)
ImageColumns.DATE_TAKEN + " DESC"// Ordering
);