Showing posts with label connecting. Show all posts
Showing posts with label connecting. Show all posts

Wednesday, March 7, 2012

Another Connection Problem

Hi all,
I am starting to work with MSDE. I have no problem connecting to the Northwind db, but every time I create a new database, I can't open it.
I have used ...
"Data Source=MyTestDb;Initial Catalog=mytable;Integrated Security=SSPI;"
the error I receive is:
Exception Details: System.Data.SqlClient.SqlException: Cannot open database requested in login 'MyTestDb'. Login fails. Login failed for user 'HOODWKOTC124874\ASPNET'.

I have also used...
what I thought was the default user id =sa; password =;

I can make a winform and drop sql objcets on the page and connect to the db that I created, just not through asp.net

FYI- I do not have Enterprise manager.

Any help would be appreciated.

ThanksOpen Enterprise manager and create a login for ASPNET and grant it perms on the MyTable db.

Hope that helps
Kashif|||I don't have enterprise manager. I am using the MSDE.|||You can use OSQL, included with MSDE. You need to have the folder that OSQL is in on your path, or be in that folder.

Using the command prompt, type the following, substituting your COMPUTERNAME and databasename:


osql -S servername\instancename -E -q
--Line numbers will appear
EXEC sp_grantlogin 'COMPUTERNAME\ASPNET'
go
use <databasename>
go
EXEC sp_grantdbaccess 'COMPUTERNAME\ASPNET'
go
EXEC sp_addrolemember 'db_owner', 'COMPUTERNAME\ASPNET'
go

Sunday, February 12, 2012

Analysis Services connexion problem using AMO via ASP.NET 2

Hi,

I've got a strange problem.
I'm developing an ASP.NET application connecting to an Analysis
Services 2005 database.

On my developpement PC I can run the web site virtually and my
connexion is ok. I can see all the databases running under my server.
BUT, when I deploy the site on the server, even if the connexion is a
success, I can't see any of my databases.

Concretly, the code looks like :

Dim oServeur As Microsoft.AnalysisServices.Server
oServeur = New Microsoft.AnalysisServices.Server
oServeur.Connect("ServerName") ' I do not type "(local)"

This part of the code is ok both on developpement and server side.

But If I add this :

My.Response.Write(oServeur.DataBases.Count)

The response is "2" on application developpement side and
"0" on the server side ...

Can someone help me please ?

This very much looks like the permissions problem. Check the security under which your ASP application is running. Check the security on the virtual directory for your application.

Edward Melomed.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

Analysis Services connexion problem using AMO via ASP.NET 2

Hi,

I've got a strange problem.
I'm developing an ASP.NET application connecting to an Analysis
Services 2005 database.

On my developpement PC I can run the web site virtually and my
connexion is ok. I can see all the databases running under my server.
BUT, when I deploy the site on the server, even if the connexion is a
success, I can't see any of my databases.

Concretly, the code looks like :

Dim oServeur As Microsoft.AnalysisServices.Server
oServeur = New Microsoft.AnalysisServices.Server
oServeur.Connect("ServerName") ' I do not type "(local)"

This part of the code is ok both on developpement and server side.

But If I add this :

My.Response.Write(oServeur.DataBases.Count)

The response is "2" on application developpement side and
"0" on the server side ...

Can someone help me please ?

This very much looks like the permissions problem. Check the security under which your ASP application is running. Check the security on the virtual directory for your application.

Edward Melomed.
--
This posting is provided "AS IS" with no warranties, and confers no rights.