Re: connecting to sql server from asp page

From: Bern Taylor (thebg_at_btinternet.com)
Date: 04/18/04


Date: Sun, 18 Apr 2004 13:26:45 +0100

In your DSN, if you include the login and password, then you are specifying
that the dsn should not use integrated authentication. However, the login
name and password in the login request from a DB-Library or Open Database
Connectivity (ODBC) client application are always ignored by SQL Server
(149398).

You have two choices - either supply the uid and pwd in the connection open
(as per Paul) or switch to integrated security and allocate IUSR_xxxx
appropriate permissions.

Bern

"Ronny Jones" <anonymous@discussions.microsoft.com> wrote in message
news:5B207EDD-6761-48CF-A924-0E3CA4756C94@microsoft.com...
> Hi,
>
> I'm trying to establish a connection to Sql Server from an asp page using
a System DSN.
> I setup the System DSN to use Sql Server authentication; the userid and
password
> were stored with the ODBC configuration utility. Sql Server is configured
to used both Windows and Sql Server authentication.
>
> I was not able to connect using the DSN from an asp page - the exception
was as follows
>
> Message "ERROR [28000] [Microsoft][ODBC SQL Server Driver][SQL
Server]Login
> failed for user '(null)'. Reason: Not associated with a trusted SQL Server
> connection.
> ERROR [28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed
> for user '(null)'. Reason: Not associated with a trusted SQL Server
> connection.
>
> The code snippet:
>
> Dim connString As String = "DSN=myDSN;"
> Dim conn As OdbcConnection = New OdbcConnection(connString)
> Try
> conn.Open()
> Catch ex As Exception
> End Try
>
> Any help or article would be appreciated.



Relevant Pages

  • Re: Programmatically create DSN usind SQL Server Authentication
    ... Not when you create the DSN programmatically. ... >Server using SQL Server Authentication. ... >is off-topic for my purpose because it only shows Windows authentication. ...
    (microsoft.public.sqlserver.odbc)
  • Programmatically create DSN usind SQL Server Authentication
    ... I am trying to programmatically create a DSN on a target system for SQL ... Server using SQL Server Authentication. ... is off-topic for my purpose because it only shows Windows authentication. ...
    (microsoft.public.sqlserver.odbc)
  • Re: Providers: DSN vs DSNLess. Data Returned is different?
    ... Are you using SQL Server? ... DSNs are basically a mechanism to save and set connection attributes at ... the DSN is setting some attribute that you aren't setting in the DSN-less ... Using ASP I found that the recordset was always closed even the ...
    (microsoft.public.data.odbc)
  • Re: SQL Connection Strings
    ... Okay, if you're using SQL Server authentication, and the ConnectionString is changing then the rights granted to the database objects are a function of the currently assigned user. ... the query plan is not going to change based on rights. ... What makes you think the SP or SQL Server will get confused? ... If the connection string is NOT unique, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: ActiveRecord connect to SqlServer
    ... getting a connection to SqlServer 2005. ...  I use my windows user name and password ...  Try leaving the:dsn part out.. ... domain authenticated by supplying a sql server authenticated user ...
    (comp.lang.ruby)

Loading