473,386 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Trigger SQL Server event from MS Access

6
Hello Everyone, I am a new user to this forum and I have a question that I posted in another forum that has not been answered.

I am using SQL Server 2005 with a MS Access frontend. How can I trigger an event (like a stored proc or query), in SQL Server with a button click on an Access Switchboard?

My particular issue is that I have a button on a MS Access Switchboard for Data Entry screens. I want to restrict access to certain users so when the button is clicked the user name is checked and if the user is in a certain users group the access is denied. I am using Windows authentication on the SQL Server backend.

Thank You
Aug 20 '07 #1
3 2148
ck9663
2,878 Expert 2GB
Hello Everyone, I am a new user to this forum and I have a question that I posted in another forum that has not been answered.

I am using SQL Server 2005 with a MS Access frontend. How can I trigger an event (like a stored proc or query), in SQL Server with a button click on an Access Switchboard?

My particular issue is that I have a button on a MS Access Switchboard for Data Entry screens. I want to restrict access to certain users so when the button is clicked the user name is checked and if the user is in a certain users group the access is denied. I am using Windows authentication on the SQL Server backend.

Thank You

I think this is more of a front-end handling than back-end...Handle it on your button OnClick event...
Aug 20 '07 #2
Jim Doherty
897 Expert 512MB
Hello Everyone, I am a new user to this forum and I have a question that I posted in another forum that has not been answered.

I am using SQL Server 2005 with a MS Access frontend. How can I trigger an event (like a stored proc or query), in SQL Server with a button click on an Access Switchboard?

My particular issue is that I have a button on a MS Access Switchboard for Data Entry screens. I want to restrict access to certain users so when the button is clicked the user name is checked and if the user is in a certain users group the access is denied. I am using Windows authentication on the SQL Server backend.

Thank You
You need to determine what group your user is in. You obviously know that on the server side but you need to return that value back to your application. One technique is to set your main menu forms recordsource to a stored procedure the return value of which is a one row SELECT providing the single ROLE that the user belongs to ie READER, READWRITE and so on. From your main menu you can then control what they can do based on the return value (it being displayed in a textbox that you place on screen. The below Stored procedure will return such a value if you reference it as the controlsource for your main menu. This gives a double whammy, in that if no value is displayed you know something is wrong ie: like your connection has not succeeded initially. You don't say what file format you are connecting to SQL server with ...ADP or MDB I am assuming ADP? I have procedures for testing user membership on my 2000 box but not as yet on 2005. I am sure there is a sproc available that has been fully compat tested for 2005 but in the absence of that here is the 2000 sproc untested where you pass in as the parameter value the network login name of the user via an access function

CREATE PROCEDURE dbo.usp_Membership
(@mynetworkuser varchar(100))
AS
SELECT susr1.name AS Membership
FROM dbo.sysusers susr1 INNER JOIN
dbo.sysmembers smbr ON smbr.groupuid = susr1.uid INNER JOIN
dbo.sysusers susr2 ON smbr.memberuid = susr2.uid
WHERE (susr2.name = @mynetworkuser)

GO

Jim
Aug 23 '07 #3
pgill
6
Hi Jim,

Thank you for your detailed explaination. I am using MDB format. I have been programming the Switchboard by SwitchboardID along with the ItemNumber to determine which switchboard the user is trying to access. If it is the Data Entry switchboard I call a stored proc on the server. This is about as far as I have got so far. I appreciate your point of view on this and I will explore it further.

Thanks Again.
Aug 23 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Tushar | last post by:
Hello, I am working on a client server application involving TOMCAT as Web server, MySQl as the DB and combination of JSP, Servlet, and JavaBeans to access and write Data back. There is...
9
by: Lauren Quantrell | last post by:
Is there a way to create a text file (such as a Windows Notepad file) by using a trigger on a table? What I want to do is to send a row of information to a table where the table: tblFileData has...
4
by: d0wsdkn02 | last post by:
I have an ASP.NET application that performs ADO.NET commands that cause triggers to be run in SQL Server 2000. My question is how would I best access the user ID from my custom .NET Principal in...
6
by: Jchick | last post by:
Im a newbie with a sql table in a MSDE database that contains fields of CustName, BrokerName, Type, Status. I am trying to write a trigger that does this: 1. When a new record in a table is...
4
by: Jim Devenish | last post by:
We have an Access database with Access front-end to Access back-end. Another company has installed a separate application using SQLServer. At present certain information in the first application is...
2
by: Tom_F | last post by:
To comp.databases.ms-access -- I would like to trigger an event when I close a form -- but ONLY when the data in the "RecordSource" table has been updated. I tried using the AfterUpdate event,...
0
by: wugon.net | last post by:
Hi , Anyone know how to monitor db2 trigger activity ? We suffer some trigger issue today and we try to monitor trigger's behavior use event monitor and db2audit, but both tools can not get...
5
by: Hubert Trzewik | last post by:
Hi, I want to have all-in-one trigger, defined like this: CREATE TRIGGER MyInsertDeleteUpdateHandler ON MyTable FOR DELETE, INSERT, UPDATE AS BEGIN (...)
1
by: daonho | last post by:
I tried to use javascript to trigger up the button click function when user press enter key from the textbox. This function work fine with a single button click such has login page. However, if the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.