Groups | Blog | Home
all groups > sql server clients > april 2005 >

sql server clients : ADO query restricting to SELECT



Ajey
4/28/2005 12:00:00 AM
Hi,
Can I restrict INSERT, DELETE, UPDATE, INTO queries in ADO? I get the
query as input from user. Run it using ADO connection. Display the result in
grid. However I want to allow only SELECT queries. Is there a property on
ADO which allows this? Otherwise I will have to do the parsing myself.

Thanks in advance.
Ajey


John Bell
4/28/2005 12:18:02 AM
Hi

You will need to restrict the access with permissions at table level. If you
allow them to write their own queries instead of using a controlled query
builder or stored procedures then you will need to do your own parsing.

You should also read up on SQL Injection such as
http://www.sqlsecurity.com/DesktopDefault.aspx?tabid=23

John


[quoted text, click to view]
Chandra
4/28/2005 12:24:02 AM
Hi,
By the post I understand that, u have a layee between the database and the
user.
The user need to send a select query and the result is displayed in the Grid.

The users are presently having a flexibility to send the any kind of query.
If they send INSERT, UPDATE or DELETE, your data will be currupted, and you
wante to restrict that.

If my prediction was correct, what I suggest you is, to use a Stored
Procedure for this purpose or open the ADO with read only permissions.

I believe this answered your question. please revert back if u have any issues

thanks and regards
Chandra



[quoted text, click to view]
AddThis Social Bookmark Button