Information générale
Catégorie:
Bases de données
Try passing the connection string into the open method of the connection object instead of setting the connection string property. Its worth a shot i guess. Otherwise, double check to make sure that the username has a sql server password set and is not set for windows authentication.
HTH
Eric
>Can anyone see what's wrong with this pls?
>
>------------------------------------------------------
>Dim sServer
>Dim sDatabase
>Dim sUserName
>Dim sPassword
>Dim oConn
>Dim oCmd
>
>sServer = "XX.XX.XX.XX"
>sDatabase = "databasename"
>sUserName = "username"
>sPassword = "XXXXXXXX"
>
>Set oConn = Server.CreateObject("ADODB.Connection")
>
>oConn.ConnectionString = "DRIVER={SQL Server};SERVER=" + sServer + _
> ";UID=" + sUserName + _
> ";PWD=" + sPassword + _
> ";DATABASE=" + sDatabase
>Set oCmd = Server.createObject("ADODB.command")
>oConn.Open
>----------------------------------------------------
>
>I am getting 'Login failed for user'username'.
>
>I can get into the sql server via query analyser with the same username and password. I don't understand why I can't get in from the asp.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement