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.
This topic is 4 years and 2 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
travisc
Posts: 9
Last visit: Thu Oct 12, 2023 12:20 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
Posts: 399
Last visit: Tue May 16, 2023 6:52 am

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: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

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: 9
Last visit: Thu Oct 12, 2023 12:20 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: 9
Last visit: Thu Oct 12, 2023 12:20 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 3069 times
What error should be in ISE
What error should be in ISE
ise.png (15.02 KiB) Viewed 3069 times
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

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.
This topic is 4 years and 2 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.