UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Use Late Or Early Binding?, Access 2010    
 
   
SemiAuto40
post Feb 26 2018, 10:38 AM
Post#1



Posts: 599
Joined: 3-April 12
From: L.A. (lower Alabama)


Which is quicker execution time and has less gotchas, sub with early binding requiring a reference to Microsoft Scripting Library or late binding which does not have the reference requirement? I am working on a front end to distribute across our company network onto individuals PCs. Ultimately I am going to have a user click on a file name and launch a PDF. I'm also struggling with the idea that if I use filesystemobject or another method - that if the PDF program is upgraded or changed that it will break my PDF view feature if I have to hard code the program name into the sub. The early or late binding or even using Dir() to check for existence of my PDF file is critical of course.

Thanks.
This post has been edited by SemiAuto40: Feb 26 2018, 10:43 AM
Go to the top of the page
 
DanielPineault
post Feb 26 2018, 10:50 AM
Post#2


UtterAccess VIP
Posts: 5,947
Joined: 30-June 11



I always recommend Late Binding for production.

http://www.devhut.net/2016/11/08/VBA-early...d-late-binding/

http://www.devhut.net/2017/02/16/VBA-early...binding-part-2/

Best of both worlds is use Early Binding in Dev and then switch to Late for production to avoid various headaches that can occur with Early Binding.




That said, we'd need to see your code. What exactly are you doing that you need to consider either or? Launching a file requires neither typically. Perhaps if you explain more, we'll be better able to guide you.



--------------------
Daniel Pineault (2010-2017 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
SemiAuto40
post Feb 26 2018, 12:26 PM
Post#3



Posts: 599
Joined: 3-April 12
From: L.A. (lower Alabama)


Working on configuring the app so that when a user clicks on a method name the PDF will open in the default PDF viewer of the users PC.

Thanks.
Go to the top of the page
 
theDBguy
post Feb 26 2018, 12:28 PM
Post#4


Access Wiki and Forums Moderator
Posts: 72,366
Joined: 19-June 07
From: SunnySandyEggo


Sounds more like you'll need the ShellExecute API rather than the FileSystemObject... iconfused.gif

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Microsoft Access MVP | Access Website | Access Blog | Email
Go to the top of the page
 
DanielPineault
post Feb 26 2018, 12:38 PM
Post#5


UtterAccess VIP
Posts: 5,947
Joined: 30-June 11



You've got several options, such as

Application.FollowHyperlink

Allen Browne's GoHyperlink

ShellExecute API



--------------------
Daniel Pineault (2010-2017 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
SemiAuto40
post Feb 26 2018, 12:41 PM
Post#6



Posts: 599
Joined: 3-April 12
From: L.A. (lower Alabama)


Of those options, which would likely be the best (faster execution) for a multi user company network of PCs?

Whichever option I need the OS to know what application is set as default for PDFs so I don't have to hard code the "acrobat32.exe" in case they change the reader/viewer.
This post has been edited by SemiAuto40: Feb 26 2018, 12:43 PM
Go to the top of the page
 
DanielPineault
post Feb 26 2018, 12:53 PM
Post#7


UtterAccess VIP
Posts: 5,947
Joined: 30-June 11



These don't require you to code applications... they use whatever is setup as the default application for the file type being opened on that PC.

As for execution times, they all work very fast, nothing to worry about there.




The issue with FollowHyperlink is that MS, at some point in time, introduced a security warning when used which becomes very annoying. This is why Allen Browne developed his GoHyperlink. Personally, if we're just talking about opening files (PDF, XLSX, DOCX, ...) then I'd use the ShellExecute API.

--------------------
Daniel Pineault (2010-2017 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
SemiAuto40
post Feb 26 2018, 01:25 PM
Post#8



Posts: 599
Joined: 3-April 12
From: L.A. (lower Alabama)


Thank you, Thank you, Thank you, for all responses thanks.gif I was going to write that I don't know what I would do without UtterAccess and you gentlemen (and ladies if any) - but what I do know is that I wouldn't be doing code with Access... it would be hopeless for me. Maybe I would try to work on playing guitar instead.

So thankful.
Go to the top of the page
 
DanielPineault
post Feb 26 2018, 03:09 PM
Post#9


UtterAccess VIP
Posts: 5,947
Joined: 30-June 11



We're all glad to help! thumbup.gif

--------------------
Daniel Pineault (2010-2017 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    18th June 2018 - 11:03 AM