AnsweredAssumed Answered

Importing an XML file into Access using Python

Question asked by daviddenham on Feb 2, 2018
Latest reply on Feb 5, 2018 by rvburton

I am working on a python application to download information from Waze that we receive in XML format.  I have the part of the code written to download the file and name it based on the time and date.  The problem that I have is automating the import of the XML file into a personal geodatabase.  I am using pypyodbc to establish the connection to the database and the cursor for the SQL statement to import the xml data.  The only example I have been able to find it for importing an Excel spreadsheet into Access.  

cnxn = pypyodbc.connect(    r'Driver={Microsoft Access Driver (*.mdb, *.accdb)};' +    r'DBQ=C:\Users\Public\Database1.accdb')crsr = cnxn.cursor()crsr.execute(    r"SELECT * INTO fromExcel " +    r"FROM [Excel 12.0 Xml;HDR=YES;IMEX=2;ACCDB=YES;DATABASE=C:\Users\Public\xlData.xlsx].[Sheet1$]")crsr.commit()crsr.close()cnxn.close()

The part after "crsr.execute(" is where I am having problems with the syntax to set the name for the table.  I cannot find much information on this part. Has anyone else dealt with this issue?

Outcomes