Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > SQL logon: aspx fails, winform ok

Reply
Thread Tools

SQL logon: aspx fails, winform ok

 
 
adam
Guest
Posts: n/a
 
      05-24-2004
On Thursday it was working, then something changed and now I can't
access my sql server database from aspx

I have simplified my code to a simple connect and query [1] where m_sql,
m_con are text boxes and m_output is a label. It fails when I pass in
either Sql#### or OleDB#### connection and command objects.

Connection strings
Ole Db: Provider=SQLOLEDB;Initial Catalog=dbName;Server=MACHINE;User ID=sa;
Sql : Initial Catalog=dbName;Server=MACHINE;User ID=sa;Integrated
Security=False;
OleDb error : OleDbException [DBNETLIB][ConnectionOpen
(Connect()).]SQL Server does not exist or access denied. Invalid
connection string attribute
Sql Error : {System.Data.SqlClient.SqlError}
Class: 20
LineNumber: 0
Message: "SQL Server does not exist or access denied."
Number: 17
Procedure: "ConnectionOpen (Connect())."
Server: ""
Source: ".Net SqlClient Data Provider"
State: 0

This same code runs ok as a win form under my own account. The simple
project runs fine from some other machines but not all. Aspx runs as
<MACHINE>\IUSR_<MACHINE>. I do not remember making and security changes
but obviously must have done.

I assume that there is some sort of security setting somewhere. I am
using the sa account in the demo with no password.

Any hints appreciated.

adam

1]
Public Sub runQuery(ByVal con As IDbConnection, ByVal cmd As
IDbCommand)
Try
m_output.Text = ""
con.ConnectionString = m_con.Text
cmd.CommandText = m_sql.Text
cmd.Connection = con
con.Open()
Dim o As Object = cmd.ExecuteScalar()
m_output.Text = o.ToString()
con.Close()
Catch ex As Exception
m_output.Text = ex.GetType().Name + vbCrLf + ex.Message
End Try
End Sub
 
Reply With Quote
 
 
 
 
Carl Prothman [MVP]
Guest
Posts: n/a
 
      05-24-2004
adam wrote:
> Sql Error : {System.Data.SqlClient.SqlError}
> Message: "SQL Server does not exist or access denied."
> Procedure: "ConnectionOpen (Connect())."
> Source: ".Net SqlClient Data Provider"
>


Adam,
There can be serveral resons why you are getting that error message..
Check out the following Microsoft KB article for solutions
http://support.microsoft.com/default...b;en-us;328306

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP

Hire top-notch developers at
http://www.able-consulting.com


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Not able to debug aspx page when called from winform moondaddy ASP .Net 1 05-18-2007 05:18 AM
Not able to debug aspx page when called from winform moondaddy ASP .Net 5 05-18-2007 03:21 AM
adding main.aspx.vb & main.aspx.resx under aspx John M ASP .Net 1 05-29-2005 09:27 PM
Re: SQL statement working in SQL Server but not in .aspx.cs page David Browne ASP .Net 0 08-21-2003 10:43 PM
Re: SQL statement working in SQL Server but not in .aspx.cs page William \(Bill\) Vaughn ASP .Net 0 08-21-2003 10:41 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57