| Author |
login failed when using ADO with SQL Server
|
|
|
| I installed SQL Server (Client & Server) on a WIN 2K machine.
I have a working program that uses ADO and runs on several other machines.
When it tries to open up SQL Server with the conn.open statement, the
program aborts with a login failed message.
The login ID is set up in SQL Server. I am using Windows authenticatation
I checked and my login ID has full authority.
I also used 'Administrator' login but that failed too.
Can anyone suggest what else I can check to see why I can't log in?
| |
|
| Can you post the conenction string here?
--
Thanks & Rate the Postings.
-Ravi-
"Ron" wrote:
> I installed SQL Server (Client & Server) on a WIN 2K machine.
> I have a working program that uses ADO and runs on several other machines.
> When it tries to open up SQL Server with the conn.open statement, the
> program aborts with a login failed message.
> The login ID is set up in SQL Server. I am using Windows authenticatation
> I checked and my login ID has full authority.
> I also used 'Administrator' login but that failed too.
> Can anyone suggest what else I can check to see why I can't log in?
| |
|
| This current code is working on other systems.
Conn.Provider = "SQLOLEDB"
Conn.Properties("Data Source").Value = serverstring
Conn.Properties("Initial Catalog").Value = dbstring
Conn.Properties("User ID").Value = userstring
Conn.Properties("Password").Value = pswdstring
"Ravi" wrote:
[color=darkred]
> Can you post the conenction string here?
>
> --
> Thanks & Rate the Postings.
> -Ravi-
>
>
> "Ron" wrote:
>
| |
|
| Refer this
http://msdn.microsoft.com/library/d...oprg01_0ahx.asp
--
Thanks & Rate the Postings.
-Ravi-
"Ron" wrote:
[color=darkred]
> This current code is working on other systems.
>
> Conn.Provider = "SQLOLEDB"
> Conn.Properties("Data Source").Value = serverstring
> Conn.Properties("Initial Catalog").Value = dbstring
> Conn.Properties("User ID").Value = userstring
> Conn.Properties("Password").Value = pswdstring
>
>
>
> "Ravi" wrote:
>
| |
|
| Also Check the MDAC version.
--
Thanks & Rate the Postings.
-Ravi-
"Ron" wrote:
[color=darkred]
> This current code is working on other systems.
>
> Conn.Provider = "SQLOLEDB"
> Conn.Properties("Data Source").Value = serverstring
> Conn.Properties("Initial Catalog").Value = dbstring
> Conn.Properties("User ID").Value = userstring
> Conn.Properties("Password").Value = pswdstring
>
>
>
> "Ravi" wrote:
>
| |
|
| I did both of that yesterday. It didn't help.
"Ravi" wrote:
[color=darkred]
> Also Check the MDAC version.
> --
> Thanks & Rate the Postings.
> -Ravi-
>
>
> "Ron" wrote:
>
| |
| Foo Man Chew 2005-07-01, 8:23 pm |
| "Working program" using what language?
If you are using Windows authentication, then why are you specifying a
username and password in your connection string? Windows authentication
doesn't work that way. I suggest learning a little more about both methods
and deciding which one your program should use.
"Ron" <Ron@discussions.microsoft.com> wrote in message
news:AD51EFF7-7512-40D7-9D8F- 8FF34F9B9662@microso
ft.com...
>I installed SQL Server (Client & Server) on a WIN 2K machine.
> I have a working program that uses ADO and runs on several other machines.
> When it tries to open up SQL Server with the conn.open statement, the
> program aborts with a login failed message.
> The login ID is set up in SQL Server. I am using Windows authenticatation
> I checked and my login ID has full authority.
> I also used 'Administrator' login but that failed too.
> Can anyone suggest what else I can check to see why I can't log in?
| |
|
| Yes I am using Windows authentication.
I tried overriding the Conn.Properties("User ID").Value = userstring
properties just to see if it would work.
When I don't specify the userid ID Property, I still get the same 'Login
Failed for MyUserID' message where it picks up my default login name that I
set up when I installed WIN 2K.
I didn't specify a password so I never need to log in.
I wonder if no password is the problem.
"Foo Man Chew" wrote:
> "Working program" using what language?
>
> If you are using Windows authentication, then why are you specifying a
> username and password in your connection string? Windows authentication
> doesn't work that way. I suggest learning a little more about both methods
> and deciding which one your program should use.
>
>
> "Ron" <Ron@discussions.microsoft.com> wrote in message
> news:AD51EFF7-7512-40D7-9D8F- 8FF34F9B9662@microso
ft.com...
>
>
>
| |
|
| The Working program is written in Visual RPG.
"Foo Man Chew" wrote:
> "Working program" using what language?
>
> If you are using Windows authentication, then why are you specifying a
> username and password in your connection string? Windows authentication
> doesn't work that way. I suggest learning a little more about both methods
> and deciding which one your program should use.
>
>
> "Ron" <Ron@discussions.microsoft.com> wrote in message
> news:AD51EFF7-7512-40D7-9D8F- 8FF34F9B9662@microso
ft.com...
>
>
>
| |
| Dan Guzman 2005-07-02, 9:23 am |
| If you want to use Windows authentication, specify 'Integrated
Security=SSPI' instead of 'User ID' and 'Password':
Conn.Provider = "SQLOLEDB"
Conn.Properties("Data Source").Value = serverstring
Conn.Properties("Initial Catalog").Value = dbstring
Conn.Properties("Integrated Security").Value = "SSPI"
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Ron" <Ron@discussions.microsoft.com> wrote in message
news:5419D4B2-62C9-4078-BCCA- 0B0C7EC2C098@microso
ft.com...[color=darkred]
> Yes I am using Windows authentication.
> I tried overriding the Conn.Properties("User ID").Value = userstring
> properties just to see if it would work.
> When I don't specify the userid ID Property, I still get the same 'Login
> Failed for MyUserID' message where it picks up my default login name that
> I
> set up when I installed WIN 2K.
> I didn't specify a password so I never need to log in.
> I wonder if no password is the problem.
>
>
> "Foo Man Chew" wrote:
>
| |
|
| Dan
That worked.
At least on my first conn.open statement.
After I open, I delete contents of a table and then do a conn.close.
I then do a select and a conn.open again.
This time it fails with a message that the Data Source is not found.
I debugged and my data source still has the same server name.
Something is wrong somwehere.
I never had to specify Conn.Properties("Integrated Security").Value = "SSPI"
before either.
Any ideas what could be happening?
By the way I use to know a Dan Guzman from Cincinnati.
"Dan Guzman" wrote:
> If you want to use Windows authentication, specify 'Integrated
> Security=SSPI' instead of 'User ID' and 'Password':
>
> Conn.Provider = "SQLOLEDB"
> Conn.Properties("Data Source").Value = serverstring
> Conn.Properties("Initial Catalog").Value = dbstring
> Conn.Properties("Integrated Security").Value = "SSPI"
>
> --
> Hope this helps.
>
> Dan Guzman
> SQL Server MVP
>
> "Ron" <Ron@discussions.microsoft.com> wrote in message
> news:5419D4B2-62C9-4078-BCCA- 0B0C7EC2C098@microso
ft.com...
>
>
>
| |
| Dan Guzman 2005-07-02, 11:23 am |
| > This time it fails with a message that the Data Source is not found.
Check all connection properties to ensure they are still set properly.
> I never had to specify Conn.Properties("Integrated Security").Value =
> "SSPI"
> before either. Any ideas what could be happening?
Perhaps you previously used an older MDAC version that defaulted to Windows
auth.
> By the way I use to know a Dan Guzman from Cincinnati.
Not me. Never been to Cincinnati; I've always lived in St. Louis.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Ron" <Ron@discussions.microsoft.com> wrote in message
news:E990B98D-C25A-445F-A520- 9A31B1F34337@microso
ft.com...[color=darkred]
> Dan
> That worked.
> At least on my first conn.open statement.
> After I open, I delete contents of a table and then do a conn.close.
> I then do a select and a conn.open again.
> This time it fails with a message that the Data Source is not found.
> I debugged and my data source still has the same server name.
> Something is wrong somwehere.
> I never had to specify Conn.Properties("Integrated Security").Value =
> "SSPI"
> before either.
> Any ideas what could be happening?
> By the way I use to know a Dan Guzman from Cincinnati.
>
> "Dan Guzman" wrote:
>
| |
| David Gugick 2005-07-02, 1:23 pm |
| Ron wrote:
> Dan
> That worked.
> At least on my first conn.open statement.
> After I open, I delete contents of a table and then do a conn.close.
> I then do a select and a conn.open again.
> This time it fails with a message that the Data Source is not found.
> I debugged and my data source still has the same server name.
> Something is wrong somwehere.
> I never had to specify Conn.Properties("Integrated Security").Value =
> "SSPI" before either.
> Any ideas what could be happening?
> By the way I use to know a Dan Guzman from Cincinnati.
>
You always need to tell the connection object how you are connecting. I
don't use the dynamic parameters as you do. I just create the connection
string and pass in the user id / password when using SQL Authentication.
For example:
Conn.Open "Data Source=ServerName;Tr
usted_Connection=yes
"
or
Conn.Open "Data Source=ServerName", UserID, Password
--
David Gugick
Quest Software
www.imceda.com
www.quest.com
|
|
|
|