Python Forum

Full Version: Create a csv file that pulls data from an .accdb file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Photo of Attachment.accdb file Attachment1.accdb



So I have several Attachment.accdb files in my directory. I need help figuring out the correct python code to first call out to my directory and to list out all the .accdb files ONLY.

So then my output data should look something like this:
Attachment1.accdb
Attachment2.accdb
Attachment3.accdb
Attachment4.accdb
Attachment5.accdb


From there I need to figure out a way to turn my output into a variable that I can call upon later.


I then need to figure out a way to make a connection to the .accdb filse and build a list of every ReqID within the .accdb file. This list will hold all the ReqIDs from all the .accdb files.


***The ID and ReqID are from the image link shown above. If I were to open up an attachment.accdb file they consist of the following table information

In the end I will have a detailed list showing:
ID (Unique integer), ReqID, name of accdb file
ID (Unique integer), ReqID, name of accdb file
ID (Unique integer), ReqID, name of accdb file
ID (Unique integer), ReqID, name of accdb file
ID (Unique integer), ReqID, name of accdb file


I am very new to python. But am in need of great guidance and assistance.