Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Security bothering me, big time!

Author  Topic 

Keybee
Starting Member

9 Posts

Posted - 2002-01-31 : 13:32:47
How do I get rid of the NT login security when accesing my database from another computer. I just wanna use the SQL-authentication. The SQL profiler doesn't notice any attempt of connection at all.

izaltsman
A custom title

1139 Posts

Posted - 2002-01-31 : 15:26:53
So I take it your server is already configured for Mixed Authentication, right? Make sure your application isn't trying to use Named Pipes to connect to the server. You may need to specify TCP/IP netlib explicitly. The easiest way to accomplish this is to set up an entry for your server in the Client Network Utility. Alternatively (if you don't have access to every client machine), you can specify the netlib right in the connect string of your application (KB article q238949):

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q238949

Go to Top of Page

Keybee
Starting Member

9 Posts

Posted - 2002-02-03 : 09:02:24
Thanks a lot izaltsman! At least now I know that the named pipes are the problem. I think I will have difficulties connecting to SQL Server with that string you directed me to:
"Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Extended Properties="DSN=yourdatasourcename;UID=sa;DATABASE=pubs;Network=dbmssocn";Initial Catalog=pubs"

How do I send this string when connecting? Im connecting to the server with the code used in the example sqldmo if that tells you anything and I dont now how to attach that string. Should I use an entirely different connection approach in my application?

A big thanks to izaltsman and any other person who can help =)
Go to Top of Page

izaltsman
A custom title

1139 Posts

Posted - 2002-02-04 : 09:46:09
I am not sure if SQL-DMO object model provides a way for you to specify netlibs (if anyone knows how to do this, please share!)... In any event I still believe your best bet would be to specify netlib via the Client Network Utility.

Go to Top of Page

Keybee
Starting Member

9 Posts

Posted - 2002-02-04 : 18:36:53
I opened up the Client Network Utility and enabled TCP/IP in the general tab. This wasnt enough, the SQL profiler still doesnt register any attempt of connection. Have any other ideas? Am I getting close now?

By the way, if it helps you to help me to solve the problem I can tell you that my application runs with no problem if I run it from a remote computer but with "remote desktop" to my computer. Am I still having problems with NT Authentication? I hope not because I want to be able to connect with the SQL Authentication only. On the other hand, the SQL profiler should at least show some kind of unsuccessfull attempt to connect if the problem was NT Authentication.

Hope you enjoy reading some really bad english =) Thanks again!

/Keybee

Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2002-02-04 : 19:58:01
Keybee,

It's the parameter Network=dbmssocn that specifies using TCP/IP, so you should be able to put that in any valid connection string. What does your connection string look like right now?

If you're going to use the Client Network Utility (and I agree with Ilya, it's a great way to go) then you have to not just enable TCP/IP but go ahead and create an alias with the alias set to use TCP/IP.

And did you verify Ilya's very first assumption that your server is setup to use Mixed authentication and not NT Only?

--------------------------------
There's a new General in town...
Go to Top of Page

Keybee
Starting Member

9 Posts

Posted - 2002-02-07 : 16:01:01
Yes, I am using mixed mode and my connect-function looks like this:

#define _SERVER "10.46.13.1"
#define _USER "tamagotchi"
#define _PWD "tamagotchi"

BOOL bConnect(_SQLServerPtr & spSQLServer)
{
BOOL bRC = FALSE;

//printf("\nAttempting to connect to %s as %s", _SERVER, _USER);

try
{
spSQLServer->Connect(_SERVER, _USER, _PWD);

bRC = TRUE;
}
catch(_com_error pCE)
{
vDisplayError(pCE);
}
return bRC;
}

How can I alter this fundtion and add the parameter Network=dbmssocn? Or should I give the Network Client Utility another try? If so, can someone please direct me to a "setup tcp/ip in the Network Client Utility" -article?

Right now I have TCP/IP and shared memory enabled and server alias=KEYBEE wich uses TCP/IP

I appreciate all the help, a truly great forum!

Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2002-02-08 : 18:50:48
Keybee, I don't know exactly how it would fit in your function. I would assume that it's just another parameter. At least when I connect from VBScript, it is.

If you have the Client Network Utility, then yes, use that and establish and alias to your server, using TCP/IP, and port 1433.


------------------------
GENERAL-ly speaking...
Go to Top of Page

Keybee
Starting Member

9 Posts

Posted - 2002-02-08 : 19:20:23
So I have done but my application still cant connect to the server. And it cant be me sending the wrong password or username with the application since SQL Profiler doesnt notice the attempt at all. If the problem was username or password than the profiler would have said so... now it says nothing =(

Go to Top of Page

izaltsman
A custom title

1139 Posts

Posted - 2002-02-11 : 10:36:26
As I said in my earlier post, this connect string parameter probably won't help you if you are working with SQL-DMO (you would only use this parameter if you were connecting through ADO).
In fact, at this point I no longer think this is a netlib problem -- you don't even have Named Pipes as an option (since you mentioned you have "shared memory" option enabled, I am guessing you might be on Win9x).

More likely this is a connectivity issue of some sort... I am not familiar with Remote Desktop, but I am wondering if you are able to ping the server while you are in Remote Desktop...

Go to Top of Page

Keybee
Starting Member

9 Posts

Posted - 2002-02-12 : 04:06:17
When I say remote desktop I mean that i am using a computer on a LAN as a client to my Win 2000 server where I have SQL Server installed. This is basically the same as using the server directly. I suspect that the problem still involves NT Auth. security. But at the same time it shouldnt be NT Auth as Im using mixed mode... Is there an end to this? =)

Go to Top of Page

Nazim
A custom title

1408 Posts

Posted - 2002-02-12 : 07:52:13
you havent replied Ilya's question . Are you able to Ping the Server??.



--------------------------------------------------------------
"Happiness is not something you experience, it's something you remember."
Go to Top of Page

Keybee
Starting Member

9 Posts

Posted - 2002-02-12 : 17:13:13
Yes, no problems with the ping.

Go to Top of Page

izaltsman
A custom title

1139 Posts

Posted - 2002-02-12 : 17:43:22
Hey Keybee, what error message are you getting when you try to connect?

My next guess would be that your connection is simply timing out. I know that there was an issue with reverse lookups in MDAC2.6 that sometimes made connecting to a SQL Server extremely slow... Try adding the IP address of your SQL server to the hosts file on the remote machine, see if that will make any difference. Also, try setting LoginTimeout property of the SQLServer object to a high number... If that fixes it, you might want to upgrade MDAC at some point.



Go to Top of Page

izaltsman
A custom title

1139 Posts

Posted - 2002-02-12 : 17:46:41
Here is an article (Q300420) that talks about this:

http://support.microsoft.com/default.aspx?scid=kb;EN;q300420

Go to Top of Page

Keybee
Starting Member

9 Posts

Posted - 2002-02-17 : 16:11:24
That doesnt seem to help either. The application shows the message "couldnt reach server" in less than 1 second so it is not exactly "searching" for the server.

Go to Top of Page
   

- Advertisement -