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

Friday, March 30, 2012

Having trouble connecting to MSDE

I have a very basic workgroup at home. I have three
computers, two of them on XP Pro (the ones I'm using MSDE
with). I was able to install MSDE and I see the icon on
my system tray. Now, I was reading how to upsize an
Access database from this page
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dnmsde/html/msdeforvs.asp
I choose to create a new database after starting the
Upsize wizard. Then I choose the server, which shows up
in the drop down box. Then it asks me for a username and
password that has "CREATE DATABASE" privileges on the
server. So I put my administrator user name and password
in, then choose the name of my new MSDE database, but it
won't connect. I then tried using no username or
password and I get another error message. What's going
on?
This is a link to my errors.
http://www.neolinkcomputers.com/stuf...tion_errors.ht
m
Thanks
hi,
"Culbert" <anonymous@.discussions.microsoft.com> ha scritto nel messaggio
news:9fc901c47908$3cad5bf0$a501280a@.phx.gbl...
> I have a very basic workgroup at home. I have three
> computers, two of them on XP Pro (the ones I'm using MSDE
> with). I was able to install MSDE and I see the icon on
> my system tray. Now, I was reading how to upsize an
> Access database from this page
> http://msdn.microsoft.com/library/default.asp?
> url=/library/en-us/dnmsde/html/msdeforvs.asp
> I choose to create a new database after starting the
> Upsize wizard. Then I choose the server, which shows up
> in the drop down box. Then it asks me for a username and
> password that has "CREATE DATABASE" privileges on the
> server. So I put my administrator user name and password
> in, then choose the name of my new MSDE database, but it
> won't connect. I then tried using no username or
> password and I get another error message. What's going
> on?
> This is a link to my errors.
> http://www.neolinkcomputers.com/stuf...tion_errors.ht
> m
> Thanks
the reported errors indicate :
a) you instance is set to only allow Windows NT (trusted) connection, which
is the default when installing MSDE on Windows NT platform... in order to
allow SQL Server authenticated connection, please have a look at
http://support.microsoft.com/default...b;en-us;285097 for further
info in order to change this behaviour both at install time and later...
b)you windows account you are using to connect to that MSDE instance is not
granted login provileges...
you have to login with a sysadmin login, usually part of
builtin\administrators of SQL Server, and grant that windows account login
privileges using sp_grantlogin system stored procedure
(http://msdn.microsoft.com/library/de...-us/tsqlref/ts
_sp_ga-gz_8dri.asp) and then grant database access to that login for all
desired databases using sp_grantdbaccess system stored procedure
(http://msdn.microsoft.com/library/de...-us/tsqlref/ts
_sp_ga-gz_290z.asp)
for your convenience, you can have a look at a free prj of mine at the link
following my sign., which provides a user interface similar to Enterprise
Manager, which provides these functionnalities too in a viusal way..
further free and/or commercial tools for managing MSDE can be found at
http://www.microsoft.com/sql/msde/partners/default.asp and
http://www.aspfaq.com/show.asp?id=2442
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.8.0 - DbaMgr ver 0.54.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||
>--Original Message--
>hi,
>"Culbert" <anonymous@.discussions.microsoft.com> ha
scritto nel messaggio[vbcol=seagreen]
>news:9fc901c47908$3cad5bf0$a501280a@.phx.gbl...
MSDE[vbcol=seagreen]
http://www.neolinkcomputers.com/stuf...tion_errors.ht
>the reported errors indicate :
>a) you instance is set to only allow Windows NT (trusted)
connection, which
>is the default when installing MSDE on Windows NT
platform... in order to
>allow SQL Server authenticated connection, please have a
look at
>http://support.microsoft.com/default.aspx?scid=kb;en-
us;285097 for further
>info in order to change this behaviour both at install
time and later...
>b)you windows account you are using to connect to that
MSDE instance is not
>granted login provileges...
>you have to login with a sysadmin login, usually part of
>builtin\administrators of SQL Server, and grant that
windows account login
>privileges using sp_grantlogin system stored procedure
>(http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/tsqlref/ts
>_sp_ga-gz_8dri.asp) and then grant database access to
that login for all
>desired databases using sp_grantdbaccess system stored
procedure
>(http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/tsqlref/ts
>_sp_ga-gz_290z.asp)
>for your convenience, you can have a look at a free prj
of mine at the link
>following my sign., which provides a user interface
similar to Enterprise
>Manager, which provides these functionnalities too in a
viusal way..
>further free and/or commercial tools for managing MSDE
can be found at
>http://www.microsoft.com/sql/msde/partners/default.asp and
>http://www.aspfaq.com/show.asp?id=2442
>--
>Andrea Montanari (Microsoft MVP - SQL Server)
>http://www.asql.biz/DbaMgr.shtm
http://italy.mvps.org
>DbaMgr2k ver 0.8.0 - DbaMgr ver 0.54.0
>(my vb6+sql-dmo little try to provide MS MSDE 1.0 and
MSDE 2000 a visual
>interface)
>-- remove DMO to reply
>.
Incredible! I haven't tried this yet, but I'm confident
that this will work. Thank you for such a great response!!
>
|||Hi,
Maybe I should start a new thread, but my problem is the same, except that I know that the problem is my TCP/IP Access is disabled to MSDE.
I have no Enterprise Manager, any idea wich registry key I need to modify to enable TCP/IP Access?
(Similar to the SQL/Windows Authentification problem?)
Thanks!|||hi,
"uritsukidoji" <uritsukidoji.1aq8cb@.mail.mcse.ms> ha scritto nel messaggio
news:uritsukidoji.1aq8cb@.mail.mcse.ms...
> Hi,
> Maybe I should start a new thread, but my problem is the same, except
> that I know that the problem is my TCP/IP Access is disabled to MSDE.
> I have no Enterprise Manager, any idea wich registry key I need to
> modify to enable TCP/IP Access?
> (Similar to the SQL/Windows Authentification problem?)
> Thanks!
have a look at Server Network Utility (svrnetcn.exe) for server side
settings, and ClientNetwork Utility (cliconfg.exe) fro client side part
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.8.0 - DbaMgr ver 0.54.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply

having trouble connecting to database

Hi I am new at this.

I have a little program written in C# in asp.net. The program basically accesses a database and stores new records. The database is supposedly already attached to MSDE so I am able to see the tables of the database inside asp.net. I can click on the individual slots of the table and modify the datas manually. However, I want to connect to the database from my C# program and be able to input data into the database via the website that the C# program produces. After I type in the data into the website and click the submit button on the website, I get an error page that says this:

Login failed for user 'sa'

the line of code thats causing this error is:

con =

new SqlConnection("data source=(local)\\NetSdk; initial catalog=Friends; user id=sa");

Why is it not able to connect to the database?

YourChild:


con =

new SqlConnection("data source=(local)\\NetSdk; initial catalog=Friends; user id=sa");



I am taking the liberty to presume that your database name is Friends.I just couldn't figure what the "\\NetSdk" means. Perhaps you can addsomething to my knowledge.

Most probably if you aren't using Integrated Security for accessing thedatabase, you'd need to specify the password in the connection stringas well. You can make it something like this:

con =new SqlConnection("data source=(local);initial catalog=Friends;user id=sa;pwd="yourpassword")
Remember,it is a bad habit to store your connection string in the code. Tryputting it in the web.config, but you might want to do this later, whenyou get the hang of things.

Smiles.|||

uXuf:

YourChild:


con =

new SqlConnection("data source=(local)\\NetSdk; initial catalog=Friends; user id=sa");



I am taking the liberty to presume that your database name is Friends. I just couldn't figure what the "\\NetSdk" means. Perhaps you can add something to my knowledge.

Most probably if you aren't using Integrated Security for accessing the database, you'd need to specify the password in the connection string as well. You can make it something like this:

con =new SqlConnection("data source=(local);initial catalog=Friends;user id=sa;pwd="yourpassword")

Remember, it is a bad habit to store your connection string in the code. Try putting it in the web.config, but you might want to do this later, when you get the hang of things.

Smiles.

Thank you it works! I'm so glad you came by! now I am in the process of trying to stick the 'userName' and 'password' into the web.config file by using:

<

identityimpersonate="true"userName="sa"password="mypassword"/>

only now when I hit compile, Windows is giving me an error that says:

"Unable to start debugging on the web server. Server side-error occurred on sending debug HTTP request." Do I need to change something else to make this work?

There is another piece of code at the top of the web.config file that looks like this:

<authenticationmode="None"/>

Should "None" be set to "Windows"?

Then there is another username and password inside the "Directory Security" in IIS via 'property' for the virtual directory corresponding to the directory of the project. Is this username and password associated with the userName and password used to access the database?

Having some trouble connecting to a database....

I am doing one of the Microsoft virtual labs "Creating ASP.NET Web Applications with C# - Part 2" using Visual Web Developer Express. I am trying to fill a gridview with database information, but it gives me the error

"An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)".

This is on the local machine that I am executing the code.

public void BindGrid(string sortfield) {//Create DataAdapter to fetch data from Prodcuts table SqlDataAdapter myCommand =new SqlDataAdapter("select * from Products", myConnection);//Create dataset and fill it with Product data DataSet ds =new DataSet(); myCommand.Fill(ds,"Products");//Bind Product data to Datagrid DataView Source = ds.Tables["Products"].DefaultView; Source.Sort = sortfield; dgProducts.DataSource = Source; dgProducts.DataBind(); }

It stops on the line "myCommand.Fill(ds, "Products"); and points out the error mentioned earlier. I am not sure what to do...any help would be greatly appreciated, thanks in advance, and I apologize as well if I have not pointed out enough information.

What does your connection string look like?|||

check this link for help:

http://support.microsoft.com/kb/914277/en-us

Thanks

|||

First of all, thank you both greatly for responding.

Smalltalk, here is the connection string:

myConnection = new SqlConnection("server=localhost;database=northwind;Trusted_Connection=yes");

Jpazgier, my connections are set at local and remote connections, plus the server is on the same machine, I have no idea why it mentions that error for me.

Thanks again, guys.

|||

Hi GWShane,

Please make sure that the server is the default instance on your machine. If you're using SQL Express, the default name for this instance might be SQLExpress. In this case, you might need to add the instance name to the DataSource like:

myConnection = new SqlConnection("server=localhost\\SQLExpress;database=northwind;Trusted_Connection=yes");

Wednesday, March 28, 2012

having problem while connecting sql 2000

im using sql server 2000 and i m facing this problem

plz tell me why is this

"An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"

You failed to connect into the SQL server. I think the IP or the host name is wrong.

Check the following site for connectionstrings

www.connectionstrings.com

Regards

|||Also make sure Named Pipes and TCP/IP network libraries are enabled for the SQL2000 instance. You can easily archieve this in Server Network Utility.|||

hai dude

i want to mentions one thing that i have previously used the same connection class made my self for connecting to the db..

but now on new another pc with new installation of sql server ,,having the same previously used setting.,,its not woking,,,

one thing more im not usgin ip based connection string ...

|||Why not use IP based connection string? IP is often more reliable than machine name, for example when DNS does not work properly so the machine name can't be intepreted?to IP.|||

yah thanks dude

its done

Monday, March 26, 2012

Having a hard time connecting to sample SQL database from ASP.Net Page

I am working through the book ASP.Net Unleashed Second Addition. I am trying to open a simple database connection. (using the sample "pubs" db from SQL Server)
I have copied the author's code exactly, but it just won't work. I keep getting this error:
What am I doing wrong???Confused [*-)]

Description:An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message:BC30182: Type expected.
Source Error:
Line 5: Line 6: Sub Page_LoadLine 7: Dim conPubs As SqlConnectionLine 8: conPubs = New SqlConnection( "server=localhost;uid=webuser;pwd=secret;database=pubs" )Line 9: conPubs.Open()
What namespaces have you imported?|||Coding for my namespace is
<%@. Import Namespace="System.Data.SqlClient" %>
This is copied directly from the authors example.... so I don't know if it is right lolWink [;)]
Then under the page_load event
I typed:
<script Runat="server">
Sub Page_Load
Dim conPubs as SqlConnection
conPubs = New SqlConnection( "Server=localhost;uid=sa;pwd=secret;database=pubs" )
conPubs. Open()
End Sub
</script>
The text "Connection Opened!" Is supposed to show up if the coding is correct...
Help hehe just a beginner :)|||Does anyone know some awesome websites that teach you Visual Studio.Net 2003 and database stuff? I have the hardest time finding things in the MSDN library....|||Try:
http://learnvisualstudio.net/|||

I don't know if VB.NEt support the continuation stuff.
If it does, may be u have to put a continuation sign at the end of line 7.
Cheers.

sql

Sunday, February 19, 2012

Hackes SQL Server 2000

Hi Folks,
i got hacked and the password perhaps also the username for connecting over enterprise manager was changed. Is there a possibility to get my old stuff back or to get the changed username and password ?
Please help.

Patrick

System: windows2000Server
DB: SQL 2000Q1 Is there a possibility to get my old stuff back or to get the changed username and password ? Please help. Patrick
System: windows2000Server
DB: SQL 2000

A1 Yes. One might redo the entire server using new secure passwords(then restore each user DB from backups taken well before the incident).|||Do you have any idea on how you were hacked ? How is sql used in your environment ? Do you have web access to your sql server through an asp page (a select/update/delete queries) - if so, you may have a problem with how the programmers created it - someone might be using sql injection to change things like the sa password.|||1. If you still have BUILTIN/Administrators login, you can change your EM registration properties from sa to WinAuth.

2. LDF/MDF files can be attached to other/reinstalled server. Users lost.|||Hi guys,

i have no chance to switch to winauth, it's not working.
But i still have admin rights on the Server ??!!??
I try now to copy the ldf/mdf files to another sql server to
access them. What will happen with my DTS packages ?

Patrick|||DTS is stored in system databases, probably msdb. You can also extract login names and probably passwords from master.

One good source is
http://www.sqlservercentral.com/

There are queries how to decrypt passwords, restore system databases ...

Master database can be attached to other server as MASTER2 and you can decrypt sa password from master2.dbo.sysxlogins !!!