locked
Access automation with VBA vs. Javascript RRS feed

  • Question

  • I can't find a Javascript API for Access.  I have also found that the Javascript documentation includes all office 365 products except Access.  I have found a VBA API for Access and all of the other office products.  I have also read that it is not recommended to place an Access file in sharepoint.

    I am trying to figure out which way to go.  Do I use VBA to integrate Access with the other products or do I use Javascript to integrate everything except for Access.  Do I have to make a choice between desktop development with VBA or web development with Javascript and find an additional way to integrate Access.

    Does the Javascript API have the detailed code that the VBA macros have for all the other office products?

    Thanks for your help,

    Jon

    Thursday, November 23, 2017 3:55 AM

Answers

  • Hi Jon,

    Before comparing VBA and Javascript, it would be helpful if you could share us what you want to achieve by them? Your goal is not clear, you only told us you want to interop with Office desktop products, but you did not share us what you want to do.

    >> I just hope that VB and VBA do not get deprecated.

    There is no roadmap to deprecate VB or VBA, and I think they will be available for a long time, there is no need to worry about it.

    If you need your project to be working on Office Online, the only option is Javascript.

    Based on your description, it seems you just need to interop with Office Desktop products, if so, I would recommend you use VBA or VB.net. They support all features by Office product, and they could interop with others like you could operate Excel, Outlook in Access.

    If you have any unclear, please feel free to let us know.

    Best Regards,

    Tao Zhou


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Jon7171 Wednesday, December 6, 2017 6:11 AM
    Tuesday, December 5, 2017 8:02 AM

All replies

  • I searched and found many relevant articles.


    Sam Hobbs
    SimpleSamples.Info


    Thursday, November 23, 2017 6:33 AM
  • Hi Jon7171,

    there is no JavaScript Api for MS Access.

    you did not mentioned your requirements and goals clearly but only ask which one is better to use.

    I suggest you to inform us your overall requirement with as much as details.

    so that we can try to provide you a solid suggestion.

    are you using Access web App. Access Web App will going to discontinue soon.

    at present, VBA Access Model is capable enough to integrate Access db with other Office Applications.

    If we talk about JavaScript Api that you can use for other Office products except Access is also not much powerful as VBA Object Model.

    you had mentioned that,"Do I have to make a choice between desktop development with VBA or web development with Javascript and find an additional way to integrate Access".

    first , we still don't know what's your requirement. what you want to do with Access and other office Application on desktop base or with Web development.

    it will be too early to suggest you one particular thing.

    as I informed you before, please provide a detailed information about your issue.

    we will try to provide you further suggestions to solve your issue.

    Regards

    Deepak   


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, November 23, 2017 8:04 AM
  • Microsoft Access is primarily a desktop database app, so I'm not sure why you would be automating from JavaScript or from any app running in a browser. On a related note, the Access Services for SharePoint have been deprecated so you shouldn't be creating anything new with it.

    If you are just working with Access database data then you certainly would not need to implement Access automation.


    Paul ~~~~ Microsoft MVP (Visual Basic)

    Thursday, November 23, 2017 3:30 PM
  • > I am trying to figure out which way to go

    We are trying to figure that out as well. What is your overall goal? JavaScript hints at a browser-based application, while Access is a desktop database. Not a perfect match. What are you trying to accomplish?

    > I have also found that the Javascript documentation includes all office 365 products except Access

    Do you have a link?


    -Tom. Microsoft Access MVP

    Friday, November 24, 2017 12:02 AM
  • Hi Jon7171,

    I can see that after creating this thread, you did not done any follow up on this issue.

    is your issue is solved?

    if yes, I suggest you to post your solution and mark it as an answer.

    if your issue is still exist then try to refer the suggestions given by the community members.

    if you have any further questions then let us know about that.

    we will try to provide further suggestions to solve the issue.

    this thread is still open and will remain open until you mark the answer.

    so please try to update the status of the issue on this thread and take appropriate action to keep this forum healthy and helpful.

    Thanks for your understanding.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, November 30, 2017 9:10 AM
  • All of the responses were very helpful.  To summarize what everyone has said for clarity in my understanding of it:

    Summary:

    Access is strictly a desktop application and only uses VBA for automation.  VBA has all the detailed code for Access automation and integration with the other Office desktop products such as Excel, Word, Outlook etc.

    Javascript is strictly used for a browser based web solution that is used with the online versions of the Office products.

    Javascript does not have the detailed code for Office automation and integration that VBA has.

    Question:

    For a browser based internet solution using Javascript, would that involve using an SQL Server Database? If so, would I use PL/SQL to automate and integrate the SQL Server Database? Would I also have to split the database into a client and server architecture and understand its administration?

    Goal:

    If I am understanding everything that everyone is saying, I think I will be sticking to a desktop application using Access and VBA as the internet route seems quite complicated. I think my goal will be creating a solution for myself and my information needs and their integration with office desktop products.

    I just hope that VB and VBA do not get deprecated.

    Thanks for everyone's help. Not sure how to reply to thread so I chose to reply to you as your help as been the most beneficial.

    Thanks,

    Jon


    • Edited by Jon7171 Tuesday, December 5, 2017 3:52 AM
    Tuesday, December 5, 2017 3:51 AM
  • Since you have decided on desktop application, we can skip with the question and its can-o-worms.

    VBA will not be deprecated before Access will. And there is no sign of either one. You have my blessing to create a desktop application in Access, with VBA programming.


    -Tom. Microsoft Access MVP

    Tuesday, December 5, 2017 4:32 AM
  • I think you are making things too complicated. VBA is the only way you can write programs that execute within Access but there are very many possible ways to write programs that execute outside of Access that use Access but from the outside. From outside Access you can do most of what VBA can do.

    JavaScript is just one of many languages you can use outside of Access and JavaScript does not have to be used in a browser. JavaScript can be used outside of a browser. It is just that for most things if you are not using a browser (it is not a web application) then many other languages are very useful too.

    So there are not a lot of very simple absolutes. JavaScript is not just for websites.

    It is difficult to help you since you are unsure of what you want. You are unsure if you want a web application or a desktop application and there are certainly significant differences. You seen to be putting the technology first and your requirements second whereas we usually determine the requirements first then decide what technology to use.



    Sam Hobbs
    SimpleSamples.Info

    Tuesday, December 5, 2017 5:03 AM
  • Hi Jon7171,

    you had asked,"For a browser based internet solution using Javascript, would that involve using an SQL Server Database? If so, would I use PL/SQL to automate and integrate the SQL Server Database? Would I also have to split the database into a client and server architecture and understand its administration?"

    first , no any official JS Api available for Access from Microsoft. so you cannot do it. no use of MS SQL needed.

    but there is a way to use Access DB with JS.

    Connect to MS Access Database with JavaScript

    but this is not recommended. as there are security issues.

    are you developing for a local machine or for any web application?

    if you are developing for the local machine then VBA will provide all the functionality that you need.

    if you are developing web application kind of thing then it is better to use MS SQL rather then MS Access.

    but, still not clear about your requirements.

    if you can inform us then we can try to provide you a better suggestion.

    you can try to refer Access Object model and check whether it is suitable for your needs or not.

    Object model (Access VBA reference)

    if you think that you had already got the answer for your question then I suggest you to mark that suggestion as an answer which help you to solve your issue.

    Disclaimer: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Thanks for your understanding.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, December 5, 2017 5:32 AM
  • For a browser based internet solution using Javascript, would that involve using an SQL Server Database? If so, would I use PL/SQL to automate and integrate the SQL Server Database? Would I also have to split the database into a client and server architecture and understand its administration?

    PL/SQL is an Oracle thing; it is not something Microsoft does. It is based on PL/1 from IBM. IBM used to (and probably still does) write their operating systems using PL/S, a version of PL/1 with modifications for writing operating systems. None of that is in the Microsoft universe.

    If you were to use SQL Server then there is no need for Access and your options grow immensely.

    Speaking of VB, Microsoft is extremely attached to the Basic language. Basic was part of DOS and I believe that before IBM contracted with Microsoft to develop DOS the Basic interpreter in  the original IBM PC was developed by Microsoft. Microsoft won't give up on Basic, it is an integral part of their heritage.



    Sam Hobbs
    SimpleSamples.Info

    Tuesday, December 5, 2017 5:49 AM
  • Hi Jon,

    Before comparing VBA and Javascript, it would be helpful if you could share us what you want to achieve by them? Your goal is not clear, you only told us you want to interop with Office desktop products, but you did not share us what you want to do.

    >> I just hope that VB and VBA do not get deprecated.

    There is no roadmap to deprecate VB or VBA, and I think they will be available for a long time, there is no need to worry about it.

    If you need your project to be working on Office Online, the only option is Javascript.

    Based on your description, it seems you just need to interop with Office Desktop products, if so, I would recommend you use VBA or VB.net. They support all features by Office product, and they could interop with others like you could operate Excel, Outlook in Access.

    If you have any unclear, please feel free to let us know.

    Best Regards,

    Tao Zhou


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Jon7171 Wednesday, December 6, 2017 6:11 AM
    Tuesday, December 5, 2017 8:02 AM
  • I found this thread and should comment with the results of my work. I'm proficient with VBA, VBScript, and JavaScript. When making HTML Applications (hta files) I use JavaScript and have no problem doing any manner of Microsoft Access automation with that. The API for JavaScript is the same as VBA or VBScript.

    Using JavaScript in this manner requires more trial and error. If doing Microsoft Access automation, the first thing to do is make an access database having the desired code with early binding and VBA. This allows intelliSense to work so syntax for methods is more easily discovered. It is not necessary to run the code, but get the syntax right.

    Having the code made with VBA, translate to JavaScript using ActiveXObject to instantiate the access application. Trial and error is required, but anything done with VBA or VBScript can be done with JavaScript.

    Friday, February 8, 2019 9:38 PM