I am facing issues while trying to query data from my excel “.xlsx” spreadsheet.
I have used a connect to database activity with the following connection string and provider name…
Connection String: “Provider=Microsoft.ACE.OLEDB.12.0;Data Source=” & ExcelDBPath & “;Extended Properties=‘Excel 12.0 Xml;HDR=YES;IMEX=1’;”
The ExcelDBPath variable is a string with the value: “XLDB.xlsx”. The excel is just a simple practice excel file with two tables, ‘people’ and ‘pets’.
This connection appears to work fine.
I then attempted to query the results from the database using an ‘execute query’ activity with the following query string: “SELECT * FROM pets”
This functioned as expected and returned all the rows and columns from the ‘pets’ table.
I then tried the same thing with the ‘people’ table instead and to my surprise no rows were returned, only column headers. I’ve also tried putting the table names in square brackets such as ‘[people]’.
I tried remaking, renaming and duplicating the table, deleting the whole excel and recreating it, making new tables and attempting to query them… But so far the only table I’ve been able to perform a select query on has been the pets table.
The only explanation I can come up with is that my connection string or provider name is wrong. I’ve tried looking around for other ones but I haven’t found another one that will work. But of course I’m sure its going to be some other silly issue that I’ve overlooked.
This is my first attempt at using excel as a database with UiPath and I have limited experience with connecting to databases in general, so any help would be greatly appreciated.
I’m using UiPath studio version 2018.2.3
Here is my .xaml file:
excel_DB.xaml (8.5 KB)
Here is my .xlsx file:
XLDB.xlsx (9.3 KB)
Thanks in advance!