How to modify data in an External data base connection using excel as a front-end - excel

I have an excel front end which connects to a number of data sources. I would like changes made to the data using the front end, to update the source. How do i do this? The connections are to locally stored workbooks. They will eventually move to network stored workbooks which others can modify directly.

Your best bet is probably a connection string. Then use some SQL queries. Although I have not tried it myself. My co-worker does it all the time - update a front-end workbook then then update another workbook automatically by VBA.
Source: https://www.connectionstrings.com/excel/

Related

Can't refresh external connection in Excel from Mac

I have an Excel workbook that has several External data connections via PowerQuery (actually from built-in Data > Get External Data, and slightly modified code in PowerQuery to include variable filenames). The connections are made to .xslx, .xlsm and .csv files.
As I read, Microsoft states that it is possible to refresh existing connections on Mac, that are made to these types of files (not sure about .xlsm, but probably that does not matter, as not a single connection refreshes). However, when I try to refresh a query, it throws an error:
[Expression.Error] The module named 'ExcelInterop' has been disabled in this context.
At first, I thought it was a connection to Named Table in the current workbook (as I read on Microsoft, it is not supported in Mac), but even when I removed it, the problem persisted. There is not really much information on Google on this issue, so I post it here. Is there a way to actually refresh the data on Mac or no? Thanks to all.

Linked Excel file opens when Access front end opens- How to stop this behavior

I have Ms access- frond end which is distributed to more than 50 Users and its works very well until today i come across a weird behavior.
today, I have linked one excel file in back end and use this linked table in front end a create a form using query (view only) and updated my front end. through my test I found that if I open two instance of my front end and open the newly created form than in second instance access open my the linked Excel file as readonly.
My question is, how can i avoid this behavior? I don't want my users to see this excel file by any way. is there any work around?
That's by design. An Excel workbook hosted on premise cannot be shared for writing.
One workaround is to create a copy of the workbook for each user. For instance, let your application copy the workbook from the shared location to a local subfolder of %LocalAppData%, the user's local data folder, and link to that.

Create a user comment field linked to read-only Oracle database

We have an application to track work orders (hundreds of thousands) built on an Oracle database. Data entry is cumbersome and report features non-existent. IT is inflexible. We do not get support from that end. Accordingly, users have created Excel "tools" to run queries and make sense of data using ADO or ODBC connections.
What we also need is a way to record comments on specific work order (WO) records and have those comments travel with those records somehow. There are multiple users using their own spreadsheets, all querying the same database.
I'm envisioning a junction-table approach, perhaps using Access, where some VBA could take a users comment from the row in the worksheet, capture the WO number, user id, date, and comment text and store it in an Access table. Those fields could then be retrieved by some more code. This would allow any user to see all comments by any other user related to a specific WO.
I'd greatly appreciate feedback ... on the practicality, preferable constructive, but brutally honest is ok too.
Much thanks,
Kevin
Apart from this being a horrible mess you could:
use SQL Server instead of access - you can get a free copy that will probably cater for your needs. Access will also work, but it is bodge. SQL server is more professional!
I would avoid doing data entry in excel. You could build a front end (possibly in Access with SQL Server backend) that allows data entry. You could add pretty simple code to all your workbooks, which will probably reference code that will be in an excel addin. The addin has code to simply open an access database, open a form and find the WO that the user was viewing in excel.
2a. Or you could use an excel addin with a data entry form, to do data entry, but beware managing the locking, refreshing and update of displayed data.
Creating excel addins is easy, (re-)distributing them is easy, access (or whatever front end you use) is designed to do record management (ie lock and update or lock and cancel or just view) etc.... Plus you want to avoid addinghte same or similar code to all your workbooks.
Each users workbook would have very simple code. Just to tell the addin what WO you want to operate on.
Do you have sharepoint? If so Access 2013 can deliver forms as webpages - very easily, so you might not even have to manage a front end access file.
Happier now?
For those that may stumble on this post, what we ended up doing was use VBA to store comments in a separate SQL database. Users double click the cell with the WO number to get an input form prompting for comments with options to add new, append or remove existing. Entries are passed to the SQL db and also to columns in the worksheet so users can see all the entries. Time stamp/Network ID provides when/who provided comment. Existing comments are fetched when users re-open file. Works great.

How can ADO.NET read a locked Excel file?

ADO.NET works fine when it comes to reading tabular data from excel files, but one problem I often run into is that if the excel file is locked by some other user there is an exception when ADO.NET attempts to retrieve the data.
Is it possible to tell ADO.NET to read contents from the excel file even if it's locked? If so, how can it be done? Do I need to add something to the connection string? The extended properties of my connection string are:
Excel 12.0;HDR=YES;IMEX=1
I had similar problem and I could not find a solution. I ended it up with timer re-trying to connect to a file.
The problem lies in the database itself. In the end of the day it is only a flat file and ADO requires exclusive access to it. You probably need to migrate your solution to MS Access mdb file or a proper(ish) database (SQLite?)

Cannot pull SAP data using Excel (Permissions issue?)

I recently (today, actually) got some new permissions to some SAP tables, but I'm getting permissions issues with importing them. Here's how my process looks right now:
I have an Access db that links to SAP tables via an ODBC connection.
In that same Access db, a set of spaghetti-like queries pulls & refines a modest data set (a dozen columns, few hundred rows, nothing special). I can run these queries without a problem.
An Excel file imports that data using Data->Import External Data->Import Data. I do this all the time. Except this time, I'm getting the dialog pictured below. Clicking OK doesn't seem to do anything. Clicking Cancel produces an "ODBC Connection Failure" message (or something like that).
Again, these queries can be run from Access just fine. But when I import those query results into Excel, I get this problem. I can get around it with a make-table query, but since someone else is maintaining the Access db, I'd rather not make any changes to it.
I was going thru my old unanswered questions and found this one. I think I solved this by using a staging table in Access to store the data and then later importing into Excel from that staging table.

Resources