Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid authorization specification

Status
Not open for further replies.

tuzojazz

Programmer
Joined
Dec 26, 2005
Messages
58
Location
MX
Hi:

I'm programming an asp.net in visual basic.net

I'm trying to connect to a data base of "sql server 2005 enterprise" named BCR.
The server name is "server1"
I'm using Windows Authentication to connect to server
The operating system is Windows Server 2003 Enterprise Edition Service Pack 1

When I run the aspx I get this error at line 21

------------------------------------------------------------

System.Data.OleDb.OleDbException: Invalid authorization specification Invalid connection string attribute at System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) at System.Data.OleDb.OleDbConnection.InitializeProvider() at System.Data.OleDb.OleDbConnection.Open() at ASP.pruebaLeeSqlServer_aspx.__Render__control1(HtmlTextWriter __output, Control parameterContainer) in Z:\Digital\pruebaLeeSqlServer.aspx:line 21

------------------------------------------------------------

This is my code:

------------------------------------------------------------
Dim str2 As String = "Provider=SQLNCLI; Server = server1; Database = BCR"
Dim cnn2 As OleDbConnection = New OleDbConnection(str2)
Dim cmd2 As New OleDbCommand()
Dim drd2 As OleDbDataReader
Try
cnn2.Open()
cmd2.Connection = cnn2''''''''''''''''''''''''''''''''''''''''''''''''''''line 21
cmd2.CommandText ="SELECT LastName FROM Employees"
drd2 = cmd2.ExecuteReader
Do While drd2.Read
%>
<%=drd2.GetString(0)%><br>
<%
Loop
drd2.Close()
Catch exc1 As Exception
%>
<%=exc1.ToString()%>
<%
Finally
cnn2.Close()
End Try

-------------------------------------------------------------

What could be wrong?
What can I do?

Thanks!!
 
1) your connection string looks a bit odd. Goto and find a good one.

2) the web server will attempt to log into the SQLServer as ASP.Net User. Make sure the ASP.Net User has permissions on the SQL Server.

3) ASP.Net can use VB.Net code, but it has a lot of unique issues (see #2), You may want to post on the ASP.Net forum (see link in sig) for more ASP.Net answers.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Thanks that ricky guy.

I'm new in sql server so

How can I make sure the ASP.Net User has permissions on the SQL Server?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top