all groups > sql server msde > march 2005 >
You're in the

sql server msde

group:

Unable to Connect to MSDE


Unable to Connect to MSDE Fred Herring
3/28/2005 8:21:05 AM
sql server msde:
I am new to msde for I have done all my develpment work with the Developer
edition of SQL. The hosting service I am using has MSDE 2000 installed on my
Windows 2000 Server. I have installed the application DBAMGR to provide a
tool for working with the database. Using DBAMGR, I was able to connect to
the SQL server and create a new database (Database1) and table (Table2). My
problem occurs when I try to access the database from my WebService
connection code. I get SQL database does not exist or access is denied.
Now, my new database and table appear to be controlled by dbo in sql. Any
suggestions?

Private con As New SqlConnection("Data
Source=localhost;trusted_connection=true;Initial Catalog=Database1")

Dim stringSQL As String = "Select
SectionID,ID,ParentID,ChildIndexList,Name,DateCreated,ControlledBy,AuthorizedToView,data,image,document,spreadsheet,IsEncrypted from " & DBTable

(DBTable is a passed in string = "Table2"

Dim MyCommand As New SqlCommand(stringSQL, con)



Re: Unable to Connect to MSDE Fred Herring
3/28/2005 9:43:04 AM
I have checked out the reference and found one area that may be affecting me,
"The Windows-level security that you are using to connect is different from
what you expect. For example, Microsoft Internet Information Services (IIS)
uses IUSR_computername". When my web service attempts to connect:

Private con As New SqlConnection("Data
Source=localhost;trusted_connection=true;Initial Catalog=Database1")

Could I be running into some sql login missmatch on users. I thought using
"trusted_connection" caused sql to ignore user issues?

Fred Herring


[quoted text, click to view]
Re: Unable to Connect to MSDE Norman Yuan
3/28/2005 12:33:28 PM
It seems that the MSDE uses Windows security (by defalult). Yu must give
either ASPNET account, or IUser_MachineName account permmision to the
database/tables/Views/SPs on the MSDE, depending what account is configured
to use the web services.

[quoted text, click to view]
SectionID,ID,ParentID,ChildIndexList,Name,DateCreated,ControlledBy,Authorize
dToView,data,image,document,spreadsheet,IsEncrypted from " & DBTable
[quoted text, click to view]

Re: Unable to Connect to MSDE Fred Herring
3/28/2005 2:49:03 PM
I am still struggling with msde logon issues. I need to connect to msde from
my iis web service. Now, when my web service thru iis attempts to contact
MSDE to logon, who does sql see as the requesting entity. My windows
login/password or something else.

Thanks,
Fred Herring

[quoted text, click to view]
Re: Unable to Connect to MSDE Norman Yuan
3/28/2005 5:38:40 PM
By default, it is ASPNET (annonumous access, no impersonation). You need to
give this account access to your database in MSDE. You need to study a bit
more on ASP.NET security to know exactly which user account is using the
ASP.NET/Web services app. It could be ASPNET, IUser_MahcineName, or a domain
account, depending on ASP.NET/Web services project configuration (usually,
look inot app.webconfig file).

[quoted text, click to view]

Re: Unable to Connect to MSDE Andrea Montanari
3/28/2005 6:49:17 PM
hi Fred,
[quoted text, click to view]

the exception ou are reported with is a generic exception raised by MDAC
when connection troubles are found... please have a look at
http://support.microsoft.com/default.aspx?scid=kb;en-us;328306&Product=sql
--
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtm http://italy.mvps.org
DbaMgr2k ver 0.11.1 - DbaMgr ver 0.57.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
--------- remove DMO to reply

Re: Unable to Connect to MSDE Fred Herring
3/29/2005 8:37:09 AM
I am still having problems connecting to the msde datatase with my web
service on my hosting computer. My database is called Database1 and has one
table called Table2. I tried creating login accounts in DBAMGR for
IUSER_ServerNafme, and ASPNET. I gave full database rights. No luck.

Private con As New SqlConnection("Data Source=localhost;trusted_connection =
true ; Initial Catalog=Database1")
Private a As Integer
<WebMethod(Description:="Requesting Dataset")> Public Function
GetData(ByVal DBTable As String) As Byte()
Dim MyData(100000) As Class1
Dim i As Integer = 0
Dim stringSQL As String = "Select
SectionID,ID,ParentID,ChildIndexList,Name
DateCreated,ControlledBy,AuthorizedToView,data,image,document,spreadsheet,IsEncrypted from " & "Table2"

I get the error, "Database does not exist or access denied. " My web service
config file has the following code relating to sql server:

<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;user id=sa;password="
cookieless="false"
timeout="20"
/>
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />

Is this telling me that my web service is using sa as its login?

Still confused,
Fred Herring

[quoted text, click to view]
AddThis Social Bookmark Button