stupid connection question

stupid connection question

Post by Davi » Thu, 21 Feb 2002 05:11:23



I'm building the ODBC BCP example in C++
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/howt...
bcht10_9xkj.asp).

I'm getting an error in the following line:
retcode = SQLConnect(hdbc1, (SQLCHAR*)"(local)", SQL_NTS, (SQLCHAR*)"sa1",
SQL_NTS, (SQLCHAR*)"password1", SQL_NTS);

I have tried all the combinations of server names, logins and passwords that I
thought would work. In the other examples I've done, I've used C#, ADO.NET and
Windows authentication, so I haven't had any trouble getting connected. For this
example I created a new login using SQL authentication, and I believe I did it
correctly. What am I missing?

Could someone give me an example including creating the login on SQL Server
2000?
TIA!
David

 
 
 

stupid connection question

Post by Narayana Vyas Kondredd » Thu, 21 Feb 2002 05:23:26


David, what's the error?

Probably your SQL Server is configured for "Windows only authentication",
that might be preventing you from connecting using SQL logins? Verify that
in Enterprise Manager (Right click on server name -> Properties -> Security
tab).

--
HTH,
Vyas, MVP (SQL Server)

http://vyaskn.tripod.com/


I'm building the ODBC BCP example in C++
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/howt...
t_od
bcht10_9xkj.asp).

I'm getting an error in the following line:
retcode = SQLConnect(hdbc1, (SQLCHAR*)"(local)", SQL_NTS, (SQLCHAR*)"sa1",
SQL_NTS, (SQLCHAR*)"password1", SQL_NTS);

I have tried all the combinations of server names, logins and passwords that
I
thought would work. In the other examples I've done, I've used C#, ADO.NET
and
Windows authentication, so I haven't had any trouble getting connected. For
this
example I created a new login using SQL authentication, and I believe I did
it
correctly. What am I missing?

Could someone give me an example including creating the login on SQL Server
2000?
TIA!
David

 
 
 

stupid connection question

Post by Davi » Thu, 21 Feb 2002 05:41:53


You were correct that it was configured for "Windows only authentication". I
corrected this problem. However, there must be another issue too. I enabled the
"sa" login with a blank password just to make it easy to test. I have a couple
more questions related to the SQLConnect line below:
1. In the second parameter, can I use the string "(local)" or should I use the
database name "MyBulkInsertTest" or a combination of both? Is it case sensitive?
2. In the 6th parameter, with a blank password, should I use the string "" or
should I use some type of null value? If null, which one (0, NULL from Sql.h,
other)?

retcode = SQLConnect(hdbc1, (SQLCHAR*)"(local)", SQL_NTS, (SQLCHAR*)"sa",
     SQL_NTS, (SQLCHAR*)"", SQL_NTS);

SQLConnect is returning a -1. That's the only error information I have available
right now.

Where can I find a clear explanation that will let me know that I have set up
the user in my database correctly?
Thanks!
David



> David, what's the error?

> Probably your SQL Server is configured for "Windows only authentication",
> that might be preventing you from connecting using SQL logins? Verify that
> in Enterprise Manager (Right click on server name -> Properties -> Security
> tab).

> --
> HTH,
> Vyas, MVP (SQL Server)

> http://vyaskn.tripod.com/



> I'm building the ODBC BCP example in C++
> (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/howt...
> t_od
> bcht10_9xkj.asp).

> I'm getting an error in the following line:
> retcode = SQLConnect(hdbc1, (SQLCHAR*)"(local)", SQL_NTS, (SQLCHAR*)"sa1",
> SQL_NTS, (SQLCHAR*)"password1", SQL_NTS);

> I have tried all the combinations of server names, logins and passwords that
> I
> thought would work. In the other examples I've done, I've used C#, ADO.NET
> and
> Windows authentication, so I haven't had any trouble getting connected. For
> this
> example I created a new login using SQL authentication, and I believe I did
> it
> correctly. What am I missing?

> Could someone give me an example including creating the login on SQL Server
> 2000?
> TIA!
> David

 
 
 

stupid connection question

Post by Narayana Vyas Kondredd » Thu, 21 Feb 2002 06:22:02


There is an example SQLConnect call in this article:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q151536
See if that helps you!
--
HTH,
Vyas, MVP (SQL Server)

http://vyaskn.tripod.com/


You were correct that it was configured for "Windows only authentication". I
corrected this problem. However, there must be another issue too. I enabled
the
"sa" login with a blank password just to make it easy to test. I have a
couple
more questions related to the SQLConnect line below:
1. In the second parameter, can I use the string "(local)" or should I use
the
database name "MyBulkInsertTest" or a combination of both? Is it case
sensitive?
2. In the 6th parameter, with a blank password, should I use the string ""
or
should I use some type of null value? If null, which one (0, NULL from
Sql.h,
other)?

retcode = SQLConnect(hdbc1, (SQLCHAR*)"(local)", SQL_NTS, (SQLCHAR*)"sa",
     SQL_NTS, (SQLCHAR*)"", SQL_NTS);

SQLConnect is returning a -1. That's the only error information I have
available
right now.

Where can I find a clear explanation that will let me know that I have set
up
the user in my database correctly?
Thanks!
David



> David, what's the error?

> Probably your SQL Server is configured for "Windows only authentication",
> that might be preventing you from connecting using SQL logins? Verify that
> in Enterprise Manager (Right click on server name -> Properties ->
Security
> tab).

> --
> HTH,
> Vyas, MVP (SQL Server)

> http://vyaskn.tripod.com/



> I'm building the ODBC BCP example in C++

(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/howt...

- Show quoted text -

Quote:> t_od
> bcht10_9xkj.asp).

> I'm getting an error in the following line:
> retcode = SQLConnect(hdbc1, (SQLCHAR*)"(local)", SQL_NTS, (SQLCHAR*)"sa1",
> SQL_NTS, (SQLCHAR*)"password1", SQL_NTS);

> I have tried all the combinations of server names, logins and passwords
that
> I
> thought would work. In the other examples I've done, I've used C#, ADO.NET
> and
> Windows authentication, so I haven't had any trouble getting connected.
For
> this
> example I created a new login using SQL authentication, and I believe I
did
> it
> correctly. What am I missing?

> Could someone give me an example including creating the login on SQL
Server
> 2000?
> TIA!
> David

 
 
 

stupid connection question

Post by Davi » Thu, 21 Feb 2002 07:50:02


Vyas,
Thanks for the additional example. I have several other examples as well but
none seem to answer my questions. In particular, the second parameter still
isn't clear. Should I use the string "(local)" or should I use the database name
("MyBulkInsertTest" in my example) or a combination of both (as a URL)? Is it
case sensitive?
In the example you provided, what does "MySQLServer" represent? Thanks again.
David



> There is an example SQLConnect call in this article:
> http://support.microsoft.com/default.aspx?scid=kb;EN-US;q151536
> See if that helps you!
> --
> HTH,
> Vyas, MVP (SQL Server)

> http://vyaskn.tripod.com/



> You were correct that it was configured for "Windows only authentication". I
> corrected this problem. However, there must be another issue too. I enabled
> the
> "sa" login with a blank password just to make it easy to test. I have a
> couple
> more questions related to the SQLConnect line below:
> 1. In the second parameter, can I use the string "(local)" or should I use
> the
> database name "MyBulkInsertTest" or a combination of both? Is it case
> sensitive?
> 2. In the 6th parameter, with a blank password, should I use the string ""
> or
> should I use some type of null value? If null, which one (0, NULL from
> Sql.h,
> other)?

> retcode = SQLConnect(hdbc1, (SQLCHAR*)"(local)", SQL_NTS, (SQLCHAR*)"sa",
>      SQL_NTS, (SQLCHAR*)"", SQL_NTS);

> SQLConnect is returning a -1. That's the only error information I have
> available
> right now.

> Where can I find a clear explanation that will let me know that I have set
> up
> the user in my database correctly?
> Thanks!
> David



> > David, what's the error?

> > Probably your SQL Server is configured for "Windows only authentication",
> > that might be preventing you from connecting using SQL logins? Verify that
> > in Enterprise Manager (Right click on server name -> Properties ->
> Security
> > tab).

> > --
> > HTH,
> > Vyas, MVP (SQL Server)

> > http://vyaskn.tripod.com/



> > I'm building the ODBC BCP example in C++

> (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/howt...
> > t_od
> > bcht10_9xkj.asp).

> > I'm getting an error in the following line:
> > retcode = SQLConnect(hdbc1, (SQLCHAR*)"(local)", SQL_NTS, (SQLCHAR*)"sa1",
> > SQL_NTS, (SQLCHAR*)"password1", SQL_NTS);

> > I have tried all the combinations of server names, logins and passwords
> that
> > I
> > thought would work. In the other examples I've done, I've used C#, ADO.NET
> > and
> > Windows authentication, so I haven't had any trouble getting connected.
> For
> > this
> > example I created a new login using SQL authentication, and I believe I
> did
> > it
> > correctly. What am I missing?

> > Could someone give me an example including creating the login on SQL
> Server
> > 2000?
> > TIA!
> > David

 
 
 

stupid connection question

Post by Narayana Vyas Kondredd » Thu, 21 Feb 2002 08:02:24


David, the second parameter is the server name. So you should use your SQL
Server name there. If you are connecting locally, you can use (local)
instead. This is not case sensitive.
--
HTH,
Vyas, MVP (SQL Server)

http://vyaskn.tripod.com/


Vyas,
Thanks for the additional example. I have several other examples as well but
none seem to answer my questions. In particular, the second parameter still
isn't clear. Should I use the string "(local)" or should I use the database
name
("MyBulkInsertTest" in my example) or a combination of both (as a URL)? Is
it
case sensitive?
In the example you provided, what does "MySQLServer" represent? Thanks
again.
David



> There is an example SQLConnect call in this article:
> http://support.microsoft.com/default.aspx?scid=kb;EN-US;q151536
> See if that helps you!
> --
> HTH,
> Vyas, MVP (SQL Server)

> http://vyaskn.tripod.com/



> You were correct that it was configured for "Windows only authentication".
I
> corrected this problem. However, there must be another issue too. I
enabled
> the
> "sa" login with a blank password just to make it easy to test. I have a
> couple
> more questions related to the SQLConnect line below:
> 1. In the second parameter, can I use the string "(local)" or should I use
> the
> database name "MyBulkInsertTest" or a combination of both? Is it case
> sensitive?
> 2. In the 6th parameter, with a blank password, should I use the string ""
> or
> should I use some type of null value? If null, which one (0, NULL from
> Sql.h,
> other)?

> retcode = SQLConnect(hdbc1, (SQLCHAR*)"(local)", SQL_NTS, (SQLCHAR*)"sa",
>      SQL_NTS, (SQLCHAR*)"", SQL_NTS);

> SQLConnect is returning a -1. That's the only error information I have
> available
> right now.

> Where can I find a clear explanation that will let me know that I have set
> up
> the user in my database correctly?
> Thanks!
> David



> > David, what's the error?

> > Probably your SQL Server is configured for "Windows only
authentication",
> > that might be preventing you from connecting using SQL logins? Verify
that
> > in Enterprise Manager (Right click on server name -> Properties ->
> Security
> > tab).

> > --
> > HTH,
> > Vyas, MVP (SQL Server)

> > http://vyaskn.tripod.com/



> > I'm building the ODBC BCP example in C++

(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/howt...

- Show quoted text -

Quote:> > t_od
> > bcht10_9xkj.asp).

> > I'm getting an error in the following line:
> > retcode = SQLConnect(hdbc1, (SQLCHAR*)"(local)", SQL_NTS,
(SQLCHAR*)"sa1",
> > SQL_NTS, (SQLCHAR*)"password1", SQL_NTS);

> > I have tried all the combinations of server names, logins and passwords
> that
> > I
> > thought would work. In the other examples I've done, I've used C#,
ADO.NET
> > and
> > Windows authentication, so I haven't had any trouble getting connected.
> For
> > this
> > example I created a new login using SQL authentication, and I believe I
> did
> > it
> > correctly. What am I missing?

> > Could someone give me an example including creating the login on SQL
> Server
> > 2000?
> > TIA!
> > David

 
 
 

stupid connection question

Post by Davi » Thu, 21 Feb 2002 10:48:28


Thanks!



> David, the second parameter is the server name. So you should use your SQL
> Server name there. If you are connecting locally, you can use (local)
> instead. This is not case sensitive.
> --
> HTH,
> Vyas, MVP (SQL Server)

> http://vyaskn.tripod.com/



> Vyas,
> Thanks for the additional example. I have several other examples as well but
> none seem to answer my questions. In particular, the second parameter still
> isn't clear. Should I use the string "(local)" or should I use the database
> name
> ("MyBulkInsertTest" in my example) or a combination of both (as a URL)? Is
> it
> case sensitive?
> In the example you provided, what does "MySQLServer" represent? Thanks
> again.
> David

 
 
 

1. stupid connection question

I'm building the ODBC BCP example in C++
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/howt...
bcht10_9xkj.asp).

I'm getting an error in the following line:
retcode = SQLConnect(hdbc1, (SQLCHAR*)"(local)", SQL_NTS, (SQLCHAR*)"sa1",
SQL_NTS, (SQLCHAR*)"password1", SQL_NTS);

I have tried all the combinations of server names, logins and passwords that I
thought would work. In the other examples I've done, I've used C#, ADO.NET and
Windows authentication, so I haven't had any trouble getting connected. For this
example I created a new login using SQL authentication, and I believe I did it
correctly. What am I missing?

Could someone give me an example including creating the login on SQL Server
2000?
TIA!
David

2. Getting IP adresses of TCP/SQL*Net connected users

3. Stupid answers to stupid questions?

4. Grammer Check in VB

5. Newbie question ( certainly stupid question)

6. Paradox DOS and Win 2000 Server

7. Stupid stupid repeating fields

8. Data Manager Limit?

9. Stupid jdbc driver, Stupid TOMCAT

10. Stupid guy and Stupid problem

11. Stupid guy and stupid problem

12. STupid guy and stupid problem

13. Stupid guy and stupid problem