Solved! Go to Solution.
Hy,
after a long time I fond a soloution in the workspace 'release'-property:
arcpy.Describe(PGDB-WS) returns something like u'3,0,0'
while arcpy.Describe(pure_MSACCESS-WS) returns somethinge like this u'400558244,2616584,323869160'
That's ok for me.
Check out the ListWorkspaces() and Describe data.
ListWorkspaces() allows you to specify if you want to find file geodatabase, personal geodatabase, sde, etc...
You can also use Describe() to get the workspace properties also.
I don't believe there is any difference between the MS Access databases. If it's created by esri or if it's create my MS Access, it's all the same file. The difference is that a spatial database has a specific set of tables in it.[....] Another solution too, would be to use file geodatabases to store spatial data instead of personal geodatabases.
You can try using a library like pyodbc and look at the tables in the database. If it has the spatial tables, then you know it's a spatial personal geodatabase.
mdb_list = gp.ListWorkspaces('*', 'Access') for each mdb in mdb_list: try: gp.CreateFeatureClass(your_arguments) except WhateverExceptionYouGetWithWrongTypeOfMDBs: pass # Just ignore (or maybe you should log something)
Why not just try to create that feature class, and if it doesn't work, just assume it's an access db. Something like:mdb_list = gp.ListWorkspaces('*', 'Access') for each mdb in mdb_list: try: gp.CreateFeatureClass(your_arguments) except WhateverExceptionYouGetWithWrongTypeOfMDBs: pass # Just ignore (or maybe you should log something)
... if gdb.endswith(".mdb"): ...
Add this simple line of code to check for Access:
... if gdb.endswith(".mdb"): ...
Hy,
after a long time I fond a soloution in the workspace 'release'-property:
arcpy.Describe(PGDB-WS) returns something like u'3,0,0'
while arcpy.Describe(pure_MSACCESS-WS) returns somethinge like this u'400558244,2616584,323869160'
That's ok for me.