Sql Error

farid

Member
Joined
May 24, 2003
Messages
9
every time I try to connect to Sql server I got this error

Login failed for user music. Reason: Not associated with a trusted SQL Server connection. Invalid connection string attribute

or any user fail even "sa"

Page Code

<%@ Page LANGUAGE="VB"%>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDB" %>
<SCRIPT LANGUAGE="VB" RUNAT="server">
Sub Page_Load(Sender As Object, E As EventArgs)
Dim oConn As OleDBConnection
Dim sConnString As String
sConnString = "Provider=SQLOLEDB;Data Source=(local);Initial Catalog=Music;UserID=music;Password=music"
oConn = New OleDBConnection(sConnString)
oConn.Open()
oConn.Close()
End Sub
</SCRIPT>
<HTML>
<BODY>
Opening a Connection!
</BODY>
</HTML>

Can any one help
 
I think it is your SQL permission problem, not the programming logic problem.

Did you try to connect using other language like VB? just to confirm what is the problem come from.

May I know how do you set your SQL permission/security when you create a user for it? like "music" user in this case? for "Music" database.
 
Ah, Ive been through this. The above poster is pretty much right. The user music either 1) doesnt exist, 2) doesnt have access to the specified database, or 3) the user isnt set as the database owner.

Is this user perhaps a windows user? A windows user is totally different then a user set up inside the database itself. If this is indeed a windows user then you need to connect using Windows Integrated Security.
 
And now I got this error

Login failed for user ASPNET. Invalid connection string attribute
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Login failed for user ASPNET. Invalid connection string attribute


why ???????????????????????
 
Did you try to connect using VB? just a simple db connection, we need to confirm whether it is database problem or .net problem. Because as you mentioned above, everything should be fine...
 

Similar threads

M
Replies
0
Views
172
Michael R. Mastro II
M
R
Replies
4
Views
153
M
L
Replies
1
Views
264
Ace Fekay [MVP Directory Services]
A
D
Replies
1
Views
71
Uncle Grumpy
U
Back
Top