Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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.

Posted

Ah, I've been through this. The above poster is pretty much right. The user music either 1) doesn't exist, 2) doesn't have access to the specified database, or 3) the user isn't 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.

Gamer extraordinaire. Programmer wannabe.
Posted

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 ???????????????????????

Posted
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...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...