473,581 Members | 2,785 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Prequalifying table names with the user name in reusable components

Hi,

I have a data driven application which has some generalized components. So,
for reuse, I am building the components so they can be reused in other
projects ... it takes almost no extra effort, just a bit of planning.

Following the security convention of only giving the user as much access as
required, I always create at least 2 users for each app; owner & user. And
recently I've had a cool idea for handling multiple sites with one DB; you
make the table owner the app owner user instead of dbo. This is useful with
a webhost, I don't have to pay extra for multiple databases OR have some
funky naming convention. You can have a separate 'users' table for each app
without name collisions. I'm sure others have done this, but I was pretty
happy with my little epiphany.

However, I have run into the following glitch:
My reusable components need to have the table owner coded into every SQL
statement! Damn it! How is this going to be reusable if every app that
uses it needs to have the same user names? Right?

Now the options as I see them are :
1. Adding an extra method 'username' parameter everywhere my connection
passed in.
2. Add the user name to the web.config file and use it when building every
sql statement.
3. Use my components as the table owner user.
4. Require an updatable view with the user as the owner, for every table
used by the component. In other words, have app_owner.users (table) as well
as app_user.users (view), and reference it like 'select * from users'.

Oracle has something called a synonym, which would allow me to remove the
prequalifying user name from all references, but SQLServer doesn't seem to
have anything comparable.

Personally, I don't like any of the options that I immediately recognize.
I'm guessing any reusable component accessing data must have the same
problem.

Is there a commonly used way to get around this?

Or does anybody see an option which I am missing?

Thanks in advance.
--
Regards,
John MacIntyre
http://www.johnmacintyre.ca
Specializing in; Database, Web-Applications, and Windows Software
Jul 21 '05 #1
2 2118
Have you looked at Microsoft's Enterprise library? They use a series
of .config files that contain information about the sql connections,
including user, etc. These files are edited using a config app that is
provided.

Here is the link:

http://tinyurl.com/5ga86

Jul 21 '05 #2
"Chris Dunaway" <du******@gmail .com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
Have you looked at Microsoft's Enterprise library? They use a series
of .config files that contain information about the sql connections,
including user, etc. These files are edited using a config app that is
provided.

Here is the link:

http://tinyurl.com/5ga86


Thanks Chris,

I will look into that.

Regards,
John
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

36
4631
by: toedipper | last post by:
Hello, I am designing a table of vehicle types, nothing special, just a list of unique vehicle types such as truck, lorry, bike, motor bike, plane, tractor etc etc For the table design I am proposing a single column table with a field name called vehicle_type and this will contain the vehicle type. Sot it will be
1
2621
by: Randy | last post by:
Access= 2002 I'm NOT a Programmer, but I have used VB in the past to do some things ( Spaghetti Code King) so I have some understanding of Coding I need to replace a text field (teacher) in Table (attendance) with a lookup fileld. the lookup field will point to a newly created table (teachers) the original DB was never intended to do...
2
23901
by: Joe | last post by:
Hi All, I am new to using the Access DB and I need some help if someone is able to give it to me. What I want to do is get the names of the columns of certain tables. Not the data in the table but the table column names. I've seen other posts that suggest using the SQL command DESCRIBE but I can't get it to work for some reason. Other...
2
3932
by: DaleMan | last post by:
Where can I learn more about reusable businesss objects and their uses? I've been reading that one of .Net's advantages is that a developer can write reusable business objects. I would like to implement these into my code and make it more portable. Thanks, Dale
2
285
by: John | last post by:
Hi, I have a data driven application which has some generalized components. So, for reuse, I am building the components so they can be reused in other projects ... it takes almost no extra effort, just a bit of planning. Following the security convention of only giving the user as much access as required, I always create at least 2 users...
5
2470
by: JonH | last post by:
Ok, I have this dynamically created table in my one of my php forms that shows the names of the people the user has entered into a text field. When they hit add a row displays, showing the name they entered. Also, an image that allows them to delete shows beside the name upon creation. The delete removes the name from the table and pushes the...
9
3249
by: john | last post by:
I have imported an Excel spreadsheet in Access. This table has 150 fields. The first field is 'user name', and all the other fields represent application names of which the value can be True of False for that particular user. User generally uses about 10 applications. I would like to divide this table into 3 tables: User, Application, and...
1
1843
by: Fix_Metal | last post by:
Hello all. I'm new to this group :) I have a problem with javascript language. I'm making an .asp page with some integrated Javascript functions. The page consists of some HTML selects and a table. The table is obviously populated from a database :) so it is dynamic. The database contains a field containing some names. This field is not a...
2
3887
by: banderson | last post by:
Hello, I have a data entry form for a table with information about buildings and am having a problem making a combo box do what I want. I would like to make the combo box show a list of unique bldg mgmt company names and then to open a building management company form to show all records with this name, so the user can find the correct branch...
0
7876
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
1
7910
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8180
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5366
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3832
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2307
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1409
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1144
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.