Hi all,

I am writing a web interface which uses a MSSQL Server 2000 database. I have checked and double checked all permissions and can't find any problems but when I run a

select * from sales

I get the 'Permission denied for `sales` database `dbasename` database owner `sqluser`

I connect with the string

mssql_connect("server","sqluser","passwd");

and this connects fine, so I am attempting to select all the components from a table that the user I connect with owns. As a sideline, I can create tables, but cannot read them in any way.

Any advice would be appreciated.
Thanks

Hi all,

I am writing a web interface which uses a MSSQL Server 2000 database. I have checked and double checked all permissions and can't find any problems but when I run a

select * from sales

I get the 'Permission denied for `sales` database `dbasename` database owner `sqluser`

I connect with the string

mssql_connect("server","sqluser","passwd");

and this connects fine, so I am attempting to select all the components from a table that the user I connect with owns. As a sideline, I can create tables, but cannot read them in any way.

Any advice would be appreciated.
Thanks

try

grant select on sales to sqluser

If you look up the grant function on msdn you can finely tune the privileges for each table/database/user/whatever.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.