Solved

Need to use view or stored procedure on SQL Server in OpenOffice Calc/Base

Posted on 2008-06-19
2
1,382 Views
Last Modified: 2013-12-27
I have a substantial Excel Workbook that it almost entirely converted to Calc.  One of the sheets in the workbook dynamically queries simple employee data from a table in one of our HR systems.  In Excel, the sheet uses a QueryTable that is linked to an ASPX located on our intranet.  Unless I'm mistaken, Calc doesn't have that functionality (you can only link to *.html...this is an option for a solution for this issue, but one I'm avoiding for several reasons.)

Instead I registerd an ADO connection to the Employees table in the SQL server, built the query I needed in Base, dropped it on the worksheet, and put a refresh macro in the createdocument event (I'm using templates over a network).  This works well as far as obtaining current data is concerned, but it's not such a good idea for security reasons.  Registering the ADO connection to the server gives any user that opens the spreadsheet access to ALL of the tables in this particular system just by hitting F4.  This includes personal information that can't be shared.

I'll need access to other systems for other workbooks I'm converting, so rather than get into a tiresome routine of manipulating SQL server login access, I created a new DB (on a different SQL server) called "OpenOffice".  The idea was that I would just create a view in this DB that gave me only the Employee Info that I need.  Then I could register this DB in base, and distribute across the network without security  concerns (The .odf is on a shared drive).  The problem is that base doesn't see views, and I'm wondering now about stored procedures as well.  Does anybody have any insight on this issue?  I'm willing to  explore other solutions as well.

         
0
Comment
Question by:largeone
2 Comments
 
LVL 2

Accepted Solution

by:
Tdl earned 250 total points
ID: 21923876
Dear largeone.

Do I get you correctly that the users of the spreadsheet only read data?
Why don't you create a view in the original database which only consists of the data the users are allowed to see? Then remove the normal (do you use public?) read permission on the table itself and add read permission on the view for all the users (use a group for simpler administration). Then they can only read what they're supposed to.
This is a often recommended design, have the base tables with no access to the users directly and use views or stored procedures.

Regards,
Marc
0
 

Author Comment

by:largeone
ID: 21928417
Marc,

Thanks for the input.  Part of the reason I was hoping to avoid a routine of SQL server permissions maintenance was that I don't fully understand them.  I can't say I have a great grasp on them now either, but since I posted this question, I've learned more (enough to do what I need anyway).  I ended up using a restricted access login (that already existed) and created several queries in base that I use to access the data I need.  I believe this is similar to what you suggested.    

My concern wasn't that they could see and/or edit data in the table that I need them to see.  It was that registering the database in OOo would leave all of the other objects exposed as well.  I also set up a table filter in the base conection, but it seems like anyone who knows a little can edit that.  If that's not the case, I'd love to hear how other people approach this.  

I'm going to leave this open for a while if that's ok.  I've sort of gotten past this issue, but I'm still curious to see if there are more suggestions.      
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question