After searching a lot on this subject, I ask for your guidance !
With Python , I have to get to multiple Access database and extract information about the content of those database (name of table, type of table, source if it's a linked table ...).
I started by using pyodbc but when I wanted to access to the table MSysObjects that contains all the data I wanted but I had an access authorization problem (" Can not read records No read permissions on "\\ xa0MSysObjects \\ xa0 ").
After some search, I found few code lines to execute in the Access DB to authorize such request. But it needed to be launch from every Access DB because of some function only usable on an Access DB.
So I decided to use win32com to see if it had some solution for that. Sadly, it didn't. I had the exact same error.
Finally it seem to that there's only few solution :
I hope I was understandable ! If you have an answer for one of the solution I thinked about or even a whole other solution, I will be really thankfull !
Best regards to all of you !
If you are OK with a non-Python solution, I would think VBA is the best tool fo rthis kind of job.
Private Sub Command1_Click()
Dim db As DAO.Database, tbl As DAO.TableDef
Dim f As DAO.Field
Set db = CurrentDb() ' Connect to current database
' Loop through each table in the database
For Each tbl In db.TableDefs
Debug.Print "Table name: ", tbl.Name
' Loop throuth each field in the table
For Each f In tbl.Fields
Debug.Print "Field: ", f.Name
Next f
Next tbl
End Sub
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.