Microsoft Access and SQL in "file open"

Hello,
I am getting an issue where im prompted with:

“The Microsoft Access database engine could not find the object ‘C:\Users\name\Downloads\test.xlsx’. Make sure the object exists and that you spell its name and the path name correctly. If ‘C:\Users\name\Downloads\test.xlsx’ is not a local object, check your network connection or contact the server administrator.”

This only happens when I try to call an SQL command in the “file open”. without this step I can run my method successfully.

Anyone knows what the error prompt means and what I am missing?

Have a nice weekend!

Hi @WictorGummesson ,

Could you include a screenshot of the steps you are using to open the file? Specifically, the SQL command being used.

Are you trying to use the access file open tab with an xlsx?

Hi,
For some reason my screen capture did not post here. Adding some additional pictures of trace + method without SQL and with (without works).

Some more background: I am creating a hit pick based on xlsx. file import. The issue im trying to work around arises when I want to use the following SQL command:

“SELECT * FROM [fileplaceholder.xlsx] WHERE [Volume] > 10”

To allow for imported variable instead of just one file I found this post which I tried to adapt to my protocol: SQL Command from variable worklist - #6 by DanHartman_Hamilton

I followed this as precisely as I could trying to use concat, replace and getfilename to work around that I have variable file names (opened from a dialogue).
Original protocol:
image


I am still learning so most likely im missing something obvious.

Hi, does the file open step look like this?

image

or like this

image

Hi Gareth,

This is the file open step:

Hi @WictorGummesson ,

Thanks for the screenshots. It looks like your FROM references the file name. For XLSX files you use the sheet name that you are reading. So your SQL should look like:

SELECT * FROM [Test] WHERE VOLUME > 10

Hello Brandon,

I understand. Is there a way to access a sheet name or would the sheet name always have to be the same? I would probably just name it Sheet1 as it is the standard when creating xlsx files if its not doable.

Thank you for the help!

Hi @WictorGummesson ,

Unfortunately, there isn’t an easy way to grab the sheet names from an Excel file in Venus. Typically, you would use fixed values for this such as Sheet1 as you mentioned.

Usually, we recommend using a text-based file instead for an input, as this eliminates the risk of a sheet being improperly named. This being said, xlsx files work just fine.

1 Like

Good to know!

Thank you for clarifying.