473,396 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

SQL logon: aspx fails, winform ok

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
Nov 18 '05 #1
1 1361
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
Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: A.M | last post by:
Hi, My WinForm.EXE app tries to write a file into network and it failes because it doesn't have permission and I don't know how can I login into network from my application. How can i logon...
2
by: suicidaltendencies | last post by:
I'm getting a logon error when creating my crystal reports. Does anyone know how to solve this Thanks Harold
2
by: Karun Karunakaran | last post by:
Hi, I am using the Crystal Enterprise .NET assemblies to generate and display a crystal report in a webform. This report connects to an SQL server (running locally) using a specific username and...
6
by: Mr Flibble | last post by:
I have a class that has a LogOn method. I'm trying to think what the advantages are two approaches I have. a) Having a bool returned containing the success of the LogOn. b) Raising an...
0
by: Marty Cruise | last post by:
I successfully deploy my application to 20 domain users. Only one new user is giving me a problem, although he can access all domain resources. When he clicks the installation link on the...
1
by: Dean Slindee | last post by:
I am writing a windows service that needs to logon to a server to import a file residing on that server. The server is on the local network, but in the dmz. Not sure is the latter makes any...
1
by: moondaddy | last post by:
I had to repost this becuase I renewed-changed my msdn alias. Also, the asnwer in the other past did not understand what I'm trying to do, so I'll attempt to clarify. I have a .net 2.0 winforms...
4
by: moondaddy | last post by:
I have a .net 1.1 winforms app that calls an aspx page which I need to debug. I also need to start the debugging process from the winform because the winform first calls a web service which passed...
1
by: WayneClements | last post by:
Does anyone know why a simple select like : SELECT SettingValue FROM sysCONFIG_SETTINGS WHERE ModuleName = N'ScheduledTask' AND SettingKey = N'Logon' should fail in oracle 10g It fails with...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.