Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Weird behaviour of an access ADP project!!

Status
Not open for further replies.

HowardIsHigh

Technical User
Apr 22, 2003
8
FR
Hi all,

Something really weird happened in my adp project. The project is a tutorial found on the msdn website (StateU.adp).
With the "sa" login i created the database and written several stored procedures. One of these stored proc. is called EnrollmentAdd and has the following code :

Alter Procedure dbo.enrollmentadd
@StudentID int,
@CourseID int
As
insert into enrollment(studentid, courseid) values (@studentid, @courseid)
return

Then, i created a new user with public+db_datareader as only rights upon the StateU database.

When i connect this user to the db and try to execute the "EnrollmentAdd" stored proc. i have the following message :

"Autorisation EXECUTE refused on the object 'enrollmentadd', database 'SateU', owner 'dbo'".

Until now, everything is normal.

BUT, if i try to re-execute the stored proc. using the same user, IT WORKS !!! Although this user doesn't any right to write on this db!!!

Can someone explain this to me? I am completly lost....:-(

Thx!
 
It seems weird, but I'm thinking that it might be first trying to execute it with an SQL login, then trying the Windows login. Just a guess.
 
Thk u for your answer,

The problem is that i don't have any windows login declared in sql server...i only have the sa account and the one with public+dbreader rights on my database.

 
If you connect to it on the computer MSDE or SQL Server is on...it shouldn't need to use a logon.
 
Hello,

I don't know why it works the second time, but did you give the ReadOnly user execute rights to the stored procedure?

Carla

Documentation: A Shaft of light into a Coded world
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top