Application access object .docmd

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
travisc
Posts: 3
Joined: Fri Nov 29, 2019 8:41 pm

Application access object .docmd

Post by travisc »

Product, powershell studio 2020 64 bit:
Operating system:
64 bit OS windows 10

I’m working on a script that uses the object access.application

When using the project it does not show any of the suggested commands under the .docmd.

$access= new-object -com access.application

$access.docmd.(nothing is suggested in studio, but in ISE it gives you a list.

Also when a error happens it gives the same error every time, ISE gives you a lot more details on errors. Like query isn’t in right format and so on.

I can attached screen shots if needed, but didn’t know if this was a known thing, I have a setting wrong, or something else.

User avatar
mxtrinidad
Site Admin
Posts: 399
Joined: Sun Mar 03, 2013 12:42 pm

Re: Application access object .docmd

Post by mxtrinidad »

Please can you provide a screenshot of the error, and it would help to have the version of Access you are currently working.

User avatar
Alexander Riedel
Posts: 7377
Joined: Tue May 29, 2007 4:43 pm

Re: Application access object .docmd

Post by Alexander Riedel »

Please also include if this is a 64 bit or a 32 Bit version of Access.
Alexander Riedel
SAPIEN Technologies, Inc.

travisc
Posts: 3
Joined: Fri Nov 29, 2019 8:41 pm

Re: Application access object .docmd

Post by travisc »

Sorry of the long wait.

Access is 2016, 32bit. Whole company uses the 32bit version.

When running in the debug it says error "ERROR: You entered an expression that has an invalid reference to the property FileSearch. This is the same error i get for all errors when running the .docmd commands.

travisc
Posts: 3
Joined: Fri Nov 29, 2019 8:41 pm

Re: Application access object .docmd

Post by travisc »

I had issues trying to add a screenshot, here are the screenshots compare the two.
Attachments
Error in Studio
Error in Studio
Studio.png (19.19 KiB) Viewed 1823 times
What error should be in ISE
What error should be in ISE
ise.png (15.02 KiB) Viewed 1823 times

User avatar
Alexander Riedel
Posts: 7377
Joined: Tue May 29, 2007 4:43 pm

Re: Application access object .docmd

Post by Alexander Riedel »

PowerShell Studio does not add to or subtract from any PowerShell error messages. We only output what the Windows PowerShell engine sends.
We have absolutely no means to investigate why the ISE would display a different error message.
I understand that this is frustrating, but you need to ask Microsoft about that.
From what little Google tells me about this, the file search property has been removed a long time ago from the Access object.
Alternatively, you could just capture the exception in your script yourself and provide some more meaningful error message based on the situation.
Alexander Riedel
SAPIEN Technologies, Inc.