Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Friday, March 30, 2012

how do I add a user?

Seems like such a simple thing. But I am pulling my hair out.
Using SQL Server 2000, SP4, on Windows 2000 Server.
I'm moving an ASP-built web app from one machine to another. It works on the
old one, not on the new. Specifically, the error I get is:
Microsoft OLE DB Provider for SQL Server (0x80040E4D)
Login failed for user 'XXX'.
(where I replaced the login name with X's.)
So I am looking on the old machine (the one that works) and the new one, to
see what differences I notice, and sure enough, in the old one, under Users,
I see the user called XXX. So I go to my new one, which doesn't have a user
by that name, and I attempt to add it. But it doesn't let me add it. In
fact, I am not sure how to add it. I right-click on Users, and try to fill
in the user name but it says that that user doesn't exist, so I can't add
it. Which is ridiculous. I mean, how does any user exist if you don't get a
chance to add them?
Middletree wrote:
> Seems like such a simple thing. But I am pulling my hair out.
> Using SQL Server 2000, SP4, on Windows 2000 Server.
> I'm moving an ASP-built web app from one machine to another. It works on the
> old one, not on the new. Specifically, the error I get is:
> Microsoft OLE DB Provider for SQL Server (0x80040E4D)
> Login failed for user 'XXX'.
> (where I replaced the login name with X's.)
>
> So I am looking on the old machine (the one that works) and the new one, to
> see what differences I notice, and sure enough, in the old one, under Users,
> I see the user called XXX. So I go to my new one, which doesn't have a user
> by that name, and I attempt to add it. But it doesn't let me add it. In
> fact, I am not sure how to add it. I right-click on Users, and try to fill
> in the user name but it says that that user doesn't exist, so I can't add
> it. Which is ridiculous. I mean, how does any user exist if you don't get a
> chance to add them?
>
>
You have to first create a LOGIN, then map that LOGIN to a database as a
USER. When you moved the database from the old server to the new, how
did you do it? If you did a backup/restore, you'll have to first drop
the user from the database before mapping the login. The user SID (an
internal ID) is stamped in the database referencing the user from the
original server.
Tracy McKibben
MCDBA
http://www.realsqlguy.com
|||I did a detach/reattach.
Your suggestion worked. Thanks!

how do I add a user?

Seems like such a simple thing. But I am pulling my hair out.
Using SQL Server 2000, SP4, on Windows 2000 Server.
I'm moving an ASP-built web app from one machine to another. It works on the
old one, not on the new. Specifically, the error I get is:
Microsoft OLE DB Provider for SQL Server (0x80040E4D)
Login failed for user 'XXX'.
(where I replaced the login name with X's.)
So I am looking on the old machine (the one that works) and the new one, to
see what differences I notice, and sure enough, in the old one, under Users,
I see the user called XXX. So I go to my new one, which doesn't have a user
by that name, and I attempt to add it. But it doesn't let me add it. In
fact, I am not sure how to add it. I right-click on Users, and try to fill
in the user name but it says that that user doesn't exist, so I can't add
it. Which is ridiculous. I mean, how does any user exist if you don't get a
chance to add them?Middletree wrote:
> Seems like such a simple thing. But I am pulling my hair out.
> Using SQL Server 2000, SP4, on Windows 2000 Server.
> I'm moving an ASP-built web app from one machine to another. It works on the
> old one, not on the new. Specifically, the error I get is:
> Microsoft OLE DB Provider for SQL Server (0x80040E4D)
> Login failed for user 'XXX'.
> (where I replaced the login name with X's.)
>
> So I am looking on the old machine (the one that works) and the new one, to
> see what differences I notice, and sure enough, in the old one, under Users,
> I see the user called XXX. So I go to my new one, which doesn't have a user
> by that name, and I attempt to add it. But it doesn't let me add it. In
> fact, I am not sure how to add it. I right-click on Users, and try to fill
> in the user name but it says that that user doesn't exist, so I can't add
> it. Which is ridiculous. I mean, how does any user exist if you don't get a
> chance to add them?
>
>
You have to first create a LOGIN, then map that LOGIN to a database as a
USER. When you moved the database from the old server to the new, how
did you do it? If you did a backup/restore, you'll have to first drop
the user from the database before mapping the login. The user SID (an
internal ID) is stamped in the database referencing the user from the
original server.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||I did a detach/reattach.
Your suggestion worked. Thanks!

how do I add a user?

Seems like such a simple thing. But I am pulling my hair out.
Using SQL Server 2000, SP4, on Windows 2000 Server.
I'm moving an ASP-built web app from one machine to another. It works on the
old one, not on the new. Specifically, the error I get is:
Microsoft OLE DB Provider for SQL Server (0x80040E4D)
Login failed for user 'XXX'.
(where I replaced the login name with X's.)
So I am looking on the old machine (the one that works) and the new one, to
see what differences I notice, and sure enough, in the old one, under Users,
I see the user called XXX. So I go to my new one, which doesn't have a user
by that name, and I attempt to add it. But it doesn't let me add it. In
fact, I am not sure how to add it. I right-click on Users, and try to fill
in the user name but it says that that user doesn't exist, so I can't add
it. Which is ridiculous. I mean, how does any user exist if you don't get a
chance to add them?Middletree wrote:
> Seems like such a simple thing. But I am pulling my hair out.
> Using SQL Server 2000, SP4, on Windows 2000 Server.
> I'm moving an ASP-built web app from one machine to another. It works on t
he
> old one, not on the new. Specifically, the error I get is:
> Microsoft OLE DB Provider for SQL Server (0x80040E4D)
> Login failed for user 'XXX'.
> (where I replaced the login name with X's.)
>
> So I am looking on the old machine (the one that works) and the new one, t
o
> see what differences I notice, and sure enough, in the old one, under User
s,
> I see the user called XXX. So I go to my new one, which doesn't have a use
r
> by that name, and I attempt to add it. But it doesn't let me add it. In
> fact, I am not sure how to add it. I right-click on Users, and try to fill
> in the user name but it says that that user doesn't exist, so I can't add
> it. Which is ridiculous. I mean, how does any user exist if you don't get
a
> chance to add them?
>
>
You have to first create a LOGIN, then map that LOGIN to a database as a
USER. When you moved the database from the old server to the new, how
did you do it? If you did a backup/restore, you'll have to first drop
the user from the database before mapping the login. The user SID (an
internal ID) is stamped in the database referencing the user from the
original server.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||I did a detach/reattach.
Your suggestion worked. Thanks!

Wednesday, March 28, 2012

How do I access MSDE?

Hi,
I don't have Visual Studio, so I'm using web matrix and MSDE. My question is, how do I get to MSDE? I don't have the enterprise manager that comes with SQL Server. Thanks
amitDownload the SQL Server Web Data Administrator
Easily manage your SQL Server and MSDE data, wherever you are. Use this tool to create and edit databases, manage users and roles, export and import database schema and data, and more—all from your favorite Web browser. Available from the Microsoft Download Center

http://www.microsoft.com/sql

I have not tried it yet, but it might be what you need.

KM|||Check outthis link which has a free Query Analyzer tool. Also here is aweb admin tool from microsoft. HTH|||That's just what I need, thanks to both!sql

How Do Add a DB Connection to a Table in SQL Server Express using Visual Web Developer?

I'm developing using Visual Web Developer and want to have a web page that shows the contents of a table. I get the error message when testing the connection through database explorer "Login failed for user ''. The user is not associated with a trusted SQL Server connection".

The database is located on a server running IIS and has SQL Server Express installed.

u may need to change the connection string to something like

Server=ServerAddress;Database=DataBase;User ID=Username;Password=Password;Trusted_Connection=False

How Do Add a DB Connection to a Table in SQL Server Express using Visual Web Developer?

I'm developing using Visual Web Developer and want to have a web page that shows the contents of a table. I get the error message when testing the connection through database explorer "Login failed for user ''. The user is not associated with a trusted SQL Server connection".

The database is located on a server running IIS and has SQL Server Express installed.

From MS:

During a logon process to SQL server the following error may appear:"Login failed for user 'username'. The user is not associated with atrusted SQL Server connection. (Microsoft SQL Server, Error: 18452)".

The SQL server has been configured to operate in "Windows Authentication Mode (Windows Authentication)" and doesn't allow
the use of SQL accounts.

Change the Authentication Mode of the SQL server from "Windows Authentication Mode (Windows Authentication)"
to "Mixed Mode (Windows Authentication and SQL Server Authentication)".

Hope this helps

sql

How do a get a listing of all available SQL Servers on a network.

I want to create a web app that will allow a user to select from a drop down or lookup all available SQL Server databases.

Thanks in advance,
Jeremyi answered my own question... hope this helps some one

To restate my problem.
I need an app that will list all of the available SQL Servers on a network. There are many ways to do this ... this is one. I would like to see better ways if anyone has time.

1. Download the SQLUtils.dll from (watch for line wrap)
http://codeproject.com/useritems/listsqlservers.asp?print=true

2. Register the SQLUtils.dll using regsvr32.exe
> regsvr32 c:/inetpub/wwwroot/lib/sqlutils.dll

3. Build your web form

// C#

using SQLUtils;

protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.ListBox ListBox1;

private void Button1_Click(object sender, System.EventArgs e)
{
SQLUtils.ListServers oSqlUtils = new SQLUtils.ListServers();
// String svr = new String();
oSqlUtils.Domain = TextBox1.Text;
oSqlUtils.GetSQLServers();
foreach( String svr in oSqlUtils.Servers )
{
ListBox1.Items.Add(svr);
} // end of foreach loop
} // end of Button1_Click()

4. You will need to add a reference in your project to the .dll file. Right click on the project and select "Add Reference". Browse to the location and select.

I also found these... (watch for line wrap)
http://www.windows2000faq.com/Articles/Index.cfm?ArticleID=14327

Friday, March 9, 2012

How can take Back-Up and restore database from a web form wsing asp.net(vb.net)

I want to give a facility to backup database restore database to the customer in my project.
Database is stored in sql server 2000.
From the website the browser can take backup by clicking BACKUP button and
restore database by clicking RESTORE button.
is it possiable in asp.net programatically ?

In SQL Server you backup a database using the "backup database" command. You restore a database using the "restore database" commands. You can lookup the complete syntax to these commands.

You issue these SQL commands from asp.net just like you would any other SQL command. The backup command will work even if others are using the database at the moment you do the backup. The biggest problem would be the restore. If you are going to restore a database over an existing database (overwrite it) then that database must not be in use or you will get an error.

Brian

|||i do not really recommend this approach whether you can or not !!!!
this is an admin job and it is better not to have a wide access to do this kind of operation..... i am not sure about if you can do it or not ... !!|||Its definitely possible, take a look at this page on MSDNhttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ba-bz_35ww.asp This details the TSQL commands that are necessary to perform the backup/restore. Once you create the commands just execute them with SqlClient.
Hope This Helps

Wednesday, March 7, 2012

How can I use SQL reporting Services to get a dynamic dataset from another web service as my rep

I found out the data I need for my SQL Report is already defined in a dynamic dataset on another web service. Is there a way to use web services to call another web service to get the dataset I need to generate a report? Examples would help if you have any, thanks for looking Smile

I think this technical article may help you.

http://msdn2.microsoft.com/en-us/library/aa964129.aspx

Simone

|||Thank you very much, this is almost exactly what I was looking for, not 100% but closer then I have been for weeks now. I just need to try and figure out now if I can send a parameter to a web service now to get the result set I need. Again, thanks... Smile

Friday, February 24, 2012

How can I use mdf files from sql server 2005 exp. edition.

Hello,

I am a candidate for web programming..I would like to desing a website and I have a good host which is supporting .net 2.0 and sql server 2005 service. So I would like to ask you

1) how can I use sql server express edition's mdf database file there. or Can I store and use this "mdf"s in ftp folder? What should I do. ..

2) I have only one database "right" there and should I manage everything in one database. For example asp.net configuration manager created ASPNETDB.mdf and ldf...so if Can you inform me about this issue?

Maybe my questions is not advance, they are very basic but I want to learn

Thank you very much for your helps.

Hi,

From your description, it seems that you want to deploy the database in your SQLExpress to the SQLServer2005 database on your host server, right?

If so, I suggest that you should use some tools to achieve that instead of attaching MDF manually. First, you may use aspnet_regsql.exe tool convert the database in SQLExpress to your local SQLServer series database. In you case it's SQLServer2005. After that, use SQLServer export and import wizard to upload the database (including table and schema) to the SQLServer2005 instance on your server.

For aspnet_regsql.exe, see:

http://msdn2.microsoft.com/en-us/library/ms229862.aspx

Thanks.