Import data from an Access database into Word - ms-word

I have created a program that runs off of an Access database on the company server. The program is running fine and I am about to release it to the office. Before I do this I would like to write a help file in case the users run into issues. However, I am running into problems here. In the program, each user has a security level that is retrieved from the database that allows them to have access to different features in the program. I would prefer that only certain users know about some of the features. In writing a help file for all of the features, I would like to have Microsoft Word read the security level from the database and only display the portions of the help file corresponding to the features the user has access to. I have tried using the following VBA code in the Document_Open event:
Set db = OpenDatabase(databasePath, False, False, databasePassword)
But I get an invalid password error (the database is password protected). I have verified the correct password several times now and still no luck. Does anyone know what I am doing wrong? Is there some other way to connect to an Access database using Word?

Why not include the help in a table with a rich text memo? Each section can be contained in a different record.
When creating such a table I generally have a help button that opens the relevant section and an extra field to allow annotation.

Related

Persisting data in word document using office add-in

I'm trying to develop word add-in which allows to modify word content. One of the requirement is to select some text and mark it:
change its style (look) - and that is done
Associate that piece of text with some custom/hidden data, ex. an ID.
I want to somehow persist that data within the document, so that:
My add-in can read the document on the start and build a list of 'marked' elements
It should work on different machines - I can create a document on one machine, later open in on other machine, and add-in should be able to retrieve that data.
So far I tried to persist that data by first, getting data as HTML, and add attributes to tags, but that didn't work.
Also tried to add some hidden div, but it was only available during word app lifetime.
Recently, found this link: https://github.com/OfficeDev/Excel-Add-in-JavaScript-PersistCustomSettings , but still it allows to persist data in scope of "browser", so, I assume that on other machine it won't work.
What are my possibilities? Maybe I shouldn't store it within a document, but if not, where?
Developing it using office-js - it should work for both Word 2013 and Word 2016 (so I don't have an access to Word 2016 specific API).
Check out https://dev.office.com/reference/add-ins/shared/settings
The Office JS Settings object allows you to save custom data that persists with the document. It is pretty straight-forward to use. Getting settings is synchronous - saving settings is async. The biggest thing is that you have to remember to call Office.settings.saveAsync() after you have made your changes using Office.settings.set() in order to actually save the changes to the document.
Moreover to Nick's answer which is absolutely correct, you can use "Binding" mechanism.
Bindings are stored in document out-of-the-box, so that, you can access those later at any time.
An example, which fits my needs:
Select some text and click on button in add-in (to call some method)
Call addFromSelectionAsync() method (you can specify an id for it to reference it later)
Access it using getAllAsync() or getByIdAsync() method at any time you need it.
More about it: https://dev.office.com/docs/add-ins/develop/bind-to-regions-in-a-document-or-spreadsheet

Extending RequestTracker tickets with external data

I'm thinking about how to extend RT (and also with the IR extension, but I don't think this makes a difference) in regards to retrieving files from external sources (e.g. sftp) and adding them as attachments to tickets. I'm asking for suggestions of how I might go about this, as I've not used RT much and never programmed in Perl before.
I'm thinking of adding an input and button in the ticket to allow the user to provide a unique ID for the file and for them to be able to click when they want to retrieve the file from the external source, so not an automatic retrieval, unless it only does it once.
I'm thinking of creating a MakeClicky (http://requesttracker.wikia.com/wiki/MakeClicky) which creates a link to a cgi script (something like 'getfile(abc.txt)'), providing the ticket ID and the UID for the file. This script would then retrieve the file and post it as a comment/reply to the ticket. A couple of things to ask:
Are comments and replies to tickets really the only way to add an attachment? I read this somewhere but cant find the source now
How would I modify the existing ticket from a cgi script? Its on the same host, would I still need to use the REST api? Or can I just import the RT modules and add a attachment/comment/reply with the attachment without using the REST api?
The other option would be to create a scrip for on create/comment/reply that would search the contents of the ticket for an identifier for the file, retrieve the file and attach it.
I'm open to suggestions, unless one of these is a good way to do it!
TIA!

Trouble shooting Oracle Form Builder error FRM-10044

I'm trying to create & save a new form using Oracle Form builder however, I get the error FRM-10044: Cannot create file.
The same thing happens when I open and save an existing form (.fmb)
I've check the folder permissions where the form is being save, it has read write access.
I've tried saving it into a differ folder and also tried creating a new folder but it still throws the same error.
I'm able to create and save a word, excel document in the new or existing folders (as mentioned-above) without any issues.
I suspect it could be something to do with the Windows Registry or System Configuration settings because I had recently shutdown/disabled so of the services in the System Configuration (using
msconfig.exe). Unfortunately, I don't remember all the options that were modified.
I've gone through numerous discussion forums, but still no luck.
Any help is appreciated.
Thanks in Advance
I've experienced the same thing. But in my case, i compiled the form on server side. The error appeared because it was remote-controlled by more than 1 person. One of the remote session was possibly locking the file creation. So I logged off the other session and try to use 1 session only when compiling the form. This happens sometimes when we're using an OS with multiuser and multisession capability.

Typing in password for every connected table from SQL Server 2008 R2 in Excel 2010 Powerpivot Addin

I've got a BI Dashboard in Excel 2010 using Powerpivot, which is connected to a number queried tables on one SQL Server. When the connections were setup, I checked the box to 'save password' on each one. However, whenever my users reopen the document and go to the Powerpivot window and select 'RefreshAll' then they have to type in the password multiple times (once for each table), which is not suitable.
I have looked here and here and seem to be experiencing the same issue as a number of other people. I have started again from scratch, ensuring that the 'save password' box is definitely checked on each connection string.
The only workaround I can think of is by user Windows Authentication, but this document is intended for widespread use, and as such this will require a lot of maintenance, and will really annoy my server admin :)
Does anyone have a workaround, or any way of resolving the problem?
This solution comes close, but doesn't seem to work in my case. Might work for others though...
Solution summary:
In the main Excel window in the Data tab, choose Connections, then select the workbook connection that corresponds to your PowerPivot connection. Click on Properties, switch to the definition tab, and mark “Save password” box.
Source:
http://cpa-it.com/password-not-saved-in-powerpivot-connection-when-using-sql-authentication/#comment-10654
I've found a workaround that works for me, but might not be an ideal solution for others.
In the main Excel window, you can create a new connection using a connection file (.odc). If you create this file on a shared network drive that all users can access, and select to store the password in the connection file, the password is -actually- stored.
You can then go on and use this connection in the PowerPivot window. It will no longer ask for a password when refreshing your tables.
Of course this is only a useful workaround within a company LAN, and if there are no security implications for storing the password on a fileserver in an odc file.

SQL Server Management Studio - Server Names Disappeared

The first dialog box you get when opening SSMS (mine is 2008 R2) allows you to choose which server you want to connect to.
I had at least six servers in that list, including a local server called something like MYPC/SQLSERVEREXPRESS
Windows Updates ran last night and rebooted my machine, and now my SSMS list of servers is gone. I can select (local) or (browse for more)
What happened to my previously saved servers and their saved login info?
The file that stores these for 2008 is found at c:\%UserProfile%\Microsoft\Microsoft SQL Server\100\Tools\Shell\SqlStudio.bin
My guess is that it is still there, but was overwritten by one of your updates, you can check it to see when it was last modified.
You should make use of registered servers and export the file to save time if this happens again.
As I understand, you want to retrieve your credentials from that file.
There is a way to restore your passwords, if you still have sqlstudio.bin file and you can see "password" entries there.
First, some theory: When SSMS saves connection object it encrypts the password using some encryprion method, that is BOUND to your windows login. If you try to copy the sqlstudio.bin to other machine/user profile, passwords will not be decrypted. So it is important that you do all actions under same windows account, that you have used then sqlstudio.bin was generated. I can not tell you, if you can directly manipulate sqlstudio.bin - I suppose there are some checksums there which will prohibit direct manipulation, but there is another way.
I know the information I written above, because I develop myself an add-in for SSMS - SSMSBoost. I have implemented there the logic to manage preferred connections (so that you actually will not need standard dialogue anymore). I use exactly the same SSMS objects to store connections and serialize then into XML, so it is easier to manipulate.The picture below shows contents of sqlstudio.bin and SSMSBoostSettings.xml for the same connections. You can recognize, that username and password binary data are the same. So, to restore your password you have to:
install ssmsboost
add preferred connection to ANY database with sql server security
open SSMSBoostSettings.xml (you will see the path to that file in settings dialogue, after you have saved settings. Just save, close and re-open it. Path is displayed at the bottom)
Close SSMS, open sqlstudio.bin and ssmsboostsettings.xml in editor
modify entry in ssmsboostsettings.xml - enter data of your server from sqlstudio.bin - adress, database name, username. Carefully copy password data.
save xml and open SSMS - SSMSBoost will now show your connection in preferred connections and you will be able to connect to database. (see second picture)