Pergunta

I'm having problems with default schema and sql in asp classic. First, I have a database 'MyDatabase', this database has the schema 'MySchema' (all tables are into this schema), also there is a user 'jdoe' with privileges over 'MyDatabase' and with a default schema 'MySchema', 'jdoe' is not sysadmin. 'jdoe' can execute from management studio the following query without errors:

SELECT columnOne FROM MyTable

The same query but from an .asp page can not find MyTable:

Dim query
query = "SELECT ColumnOne FROM MyTable"

Asp pages are using ADODB.Command and user 'jdoe'. The query returns results if I specify explictly the schema:

Dim query
query = "SELECT ColumnOne FROM MySchema.MyTable"

I searched the web but all answer say the same: Asign a default schema to 'jdoe',but i did it and works with t-sql in the server or dabatase like stored procedures but not work with querys like I have in asp pages.

Does exist some special configuration?

thanks.

Foi útil?

Solução

Solved:

I don't know what happened, i change sql server user 'jdoe' by windows user(domain\user) and it works, i configured windows user the same way, assigning a default schema and with no sysadmin privileges. From asp pages i used a DSN with windows authentication and from IIS i configured website security directory to allow anonymous access and i used the same user i used in sql server.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top