0

My task is read data from *.mdb files using Mapbasic. Code to open MS Access database is seen in help immediately:

Register Table source_file Type ACCESS Table table_name

where source_file is database file and table_name is table inside db.

But database files will be differentand I don't know what tables they will contain. How can I list tables in Access database?

1

You need to access the system tables in MS Access to get a list of the available tables/views.

This has been discussed earlier on stackoverflow

You might be able to get to the entire context of the system table using this MapBasic statement:

Register Table "C:\my access database.mbd" Type ACCESS Table "MSysObjects"

Once you have the table open in MapInfo Pro, you can query this table using the SQL statement.

If not, you might have to use ODBC to get access tot he system tables

Also note that the discussion I link to above mention issues with permission. You need to give the Admin permission to access the System tables.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.