Board index » delphi » Trusted Connection to SQL 2000 thru BDE

Trusted Connection to SQL 2000 thru BDE


2005-03-09 12:22:34 AM
delphi205
I am trying to set-up trusted (Windows) connection thru BDE alias to MS SQL 2000 using Delphi 5.
Currently we have 'normal' mechanism to connect to database. I create BDE connection on fly and supply the following parameters:
procedure TFrmMain.dbNewMWLogin(Database: TDatabase;
LoginParams: TStrings);
begin
LoginParams.Values['USER NAME']:=gvLogin_User;
LoginParams.Values['PASSWORD']:= 'abc123';
end;
However, we have to get rid of hardcoded password, since it is the firm policy. I can connect thru ISQL using my Windows account. Could someone help and let me know how I can do it by BDE. To replace BDE is NOT an option, since the application works fine and have about 3,000 database objects tied with BDE connection.
 
 

Re:Trusted Connection to SQL 2000 thru BDE

I think you will have to ensure that the TDatabase object is connectioning using the "Sql
Server" ODBC driver and not the "MS SQL" SqlLinks driver. Next in the ODBC administrator on
each client the Trusted connection must be enabled, this is just a registry entry so you
should be able to handle in code at runtime. After that just setting the Username/Password
to be blank should be all that is required.
 

Re:Trusted Connection to SQL 2000 thru BDE

Thank you Dennis,
but creating ODBC connection is not preferable way.
Do you know if that can be achived with native MS SQL
Dennis Passmore <>writes:
Quote
I think you will have to ensure that the TDatabase object is connectioning using the "Sql
Server" ODBC driver and not the "MS SQL" SqlLinks driver. Next in the ODBC administrator on
each client the Trusted connection must be enabled, this is just a registry entry so you
should be able to handle in code at runtime. After that just setting the Username/Password
to be blank should be all that is required.


 

Re:Trusted Connection to SQL 2000 thru BDE

You have to clear the USERNAME parameter in the BDE admin parameters, both
for your alias (the "Database" tab) and the parameters for the native BDE
MS SQL driver (the "Configuration" tab).
Also, for a trusted connection to work, you need to open a Windows domain
session on the client, and grant database access to that Windows domain user
account on your MS SQL server.
--
Alain Quesnel
XXXX@XXXXX.COM
www.logiquel.com
"marina davydova" <XXXX@XXXXX.COM>writes
Quote

Thank you Dennis,
but creating ODBC connection is not preferable way.
Do you know if that can be achived with native MS SQL

Dennis Passmore <>writes:
>I think you will have to ensure that the TDatabase object is connectioning
>using the "Sql
>Server" ODBC driver and not the "MS SQL" SqlLinks driver. Next in the ODBC
>administrator on
>each client the Trusted connection must be enabled, this is just a
>registry entry so you
>should be able to handle in code at runtime. After that just setting the
>Username/Password
>to be blank should be all that is required.
>
>

 

Re:Trusted Connection to SQL 2000 thru BDE

Thank you, Alain.
I already cleared the USERNAME parameter in the BDE admin parameters, in both places: (the "Database" tab) and the parameters for the native BDE MS SQL driver (the "Configuration" tab).
However, I don't understand how I need to open a Windows domain session on the client.
If I use ISQL, I am able to connect as Windows authentication without any issues.
Can be the problem related with version of MS SQL? I am using MS SQL 2000.
Thank you in advance, Marina
"Alain Quesnel" <XXXX@XXXXX.COM>writes:
Quote
You have to clear the USERNAME parameter in the BDE admin parameters, both
for your alias (the "Database" tab) and the parameters for the native BDE
MS SQL driver (the "Configuration" tab).

Also, for a trusted connection to work, you need to open a Windows domain
session on the client, and grant database access to that Windows domain user
account on your MS SQL server.

--

Alain Quesnel
XXXX@XXXXX.COM

www.logiquel.com


"marina davydova" <XXXX@XXXXX.COM>writes
news:422df5f9$XXXX@XXXXX.COM...
>
>Thank you Dennis,
>but creating ODBC connection is not preferable way.
>Do you know if that can be achived with native MS SQL
>
>Dennis Passmore <>writes:
>>I think you will have to ensure that the TDatabase object is connectioning
>>using the "Sql
>>Server" ODBC driver and not the "MS SQL" SqlLinks driver. Next in the ODBC
>>administrator on
>>each client the Trusted connection must be enabled, this is just a
>>registry entry so you
>>should be able to handle in code at runtime. After that just setting the
>>Username/Password
>>to be blank should be all that is required.
>>
>>
>


 

Re:Trusted Connection to SQL 2000 thru BDE

From your client, try to log on using Microsoft Query Analyzer with Windows
Authentication (as opposed to SQL Authentication). If that doesn't work,
then the issue probably isn't with the BDE.
--
Alain Quesnel
XXXX@XXXXX.COM
www.logiquel.com
"Marina Davydova" <XXXX@XXXXX.COM>writes
Quote

Thank you, Alain.
I already cleared the USERNAME parameter in the BDE admin parameters, in
both places: (the "Database" tab) and the parameters for the native BDE
MS SQL driver (the "Configuration" tab).

However, I don't understand how I need to open a Windows domain session on
the client.
If I use ISQL, I am able to connect as Windows authentication without any
issues.
Can be the problem related with version of MS SQL? I am using MS SQL 2000.
Thank you in advance, Marina

"Alain Quesnel" <XXXX@XXXXX.COM>writes:
>You have to clear the USERNAME parameter in the BDE admin parameters, both
>for your alias (the "Database" tab) and the parameters for the native BDE
>MS SQL driver (the "Configuration" tab).
>
>Also, for a trusted connection to work, you need to open a Windows domain
>session on the client, and grant database access to that Windows domain
>user
>account on your MS SQL server.
>
>--
>
>Alain Quesnel
>XXXX@XXXXX.COM
>
>www.logiquel.com
>
>
>"marina davydova" <XXXX@XXXXX.COM>writes
>news:422df5f9$XXXX@XXXXX.COM...
>>
>>Thank you Dennis,
>>but creating ODBC connection is not preferable way.
>>Do you know if that can be achived with native MS SQL
>>
>>Dennis Passmore <>writes:
>>>I think you will have to ensure that the TDatabase object is
>>>connectioning
>>>using the "Sql
>>>Server" ODBC driver and not the "MS SQL" SqlLinks driver. Next in the
>>>ODBC
>>>administrator on
>>>each client the Trusted connection must be enabled, this is just a
>>>registry entry so you
>>>should be able to handle in code at runtime. After that just setting the
>>>Username/Password
>>>to be blank should be all that is required.
>>>
>>>
>>
>
>

 

Re:Trusted Connection to SQL 2000 thru BDE

Alain, I can connect to database using Microsoft Query Analyzer with Windows authentication without any problem. However, if I tried to connect from BDE database set-up, I still was prompted
tto enter user name and password. Ileft those fields blank and
recieved error messega: "Login failed for user ('Null') Reaseon - not assotiated with trusted connection.
Thank you in advance, Marina
"Alain Quesnel" <XXXX@XXXXX.COM>writes:
Quote
From your client, try to log on using Microsoft Query Analyzer with Windows
Authentication (as opposed to SQL Authentication). If that doesn't work,
then the issue probably isn't with the BDE.

--

Alain Quesnel
XXXX@XXXXX.COM

www.logiquel.com


"Marina Davydova" <XXXX@XXXXX.COM>writes
news:422f133f$XXXX@XXXXX.COM...
>
>Thank you, Alain.
>I already cleared the USERNAME parameter in the BDE admin parameters, in
>both places: (the "Database" tab) and the parameters for the native BDE
>MS SQL driver (the "Configuration" tab).
>
>However, I don't understand how I need to open a Windows domain session on
>the client.
>If I use ISQL, I am able to connect as Windows authentication without any
>issues.
>Can be the problem related with version of MS SQL? I am using MS SQL 2000.
>Thank you in advance, Marina
>
>"Alain Quesnel" <XXXX@XXXXX.COM>writes:
>>You have to clear the USERNAME parameter in the BDE admin parameters, both
>>for your alias (the "Database" tab) and the parameters for the native BDE
>>MS SQL driver (the "Configuration" tab).
>>
>>Also, for a trusted connection to work, you need to open a Windows domain
>>session on the client, and grant database access to that Windows domain
>>user
>>account on your MS SQL server.
>>
>>--
>>
>>Alain Quesnel
>>XXXX@XXXXX.COM
>>
>>www.logiquel.com
>>
>>
>>"marina davydova" <XXXX@XXXXX.COM>writes
>>news:422df5f9$XXXX@XXXXX.COM...
>>>
>>>Thank you Dennis,
>>>but creating ODBC connection is not preferable way.
>>>Do you know if that can be achived with native MS SQL
>>>
>>>Dennis Passmore <>writes:
>>>>I think you will have to ensure that the TDatabase object is
>>>>connectioning
>>>>using the "Sql
>>>>Server" ODBC driver and not the "MS SQL" SqlLinks driver. Next in the
>>>>ODBC
>>>>administrator on
>>>>each client the Trusted connection must be enabled, this is just a
>>>>registry entry so you
>>>>should be able to handle in code at runtime. After that just setting the
>>>>Username/Password
>>>>to be blank should be all that is required.
>>>>
>>>>
>>>
>>
>>
>


 

Re:Trusted Connection to SQL 2000 thru BDE

Have you tried Borland Database Explorer (the database utility that comes
with Delphi)?
--
Alain Quesnel
XXXX@XXXXX.COM
www.logiquel.com
"marina davydova" <XXXX@XXXXX.COM>writes
Quote

Alain, I can connect to database using Microsoft Query Analyzer with
Windows authentication without any problem. However, if I tried to connect
from BDE database set-up, I still was prompted
tto enter user name and password. Ileft those fields blank and
recieved error messega: "Login failed for user ('Null') Reaseon - not
assotiated with trusted connection.

Thank you in advance, Marina

"Alain Quesnel" <XXXX@XXXXX.COM>writes:
>From your client, try to log on using Microsoft Query Analyzer with
>Windows
>Authentication (as opposed to SQL Authentication). If that doesn't work,
>then the issue probably isn't with the BDE.
>
>--
>
>Alain Quesnel
>XXXX@XXXXX.COM
>
>www.logiquel.com
>
>
>"Marina Davydova" <XXXX@XXXXX.COM>writes
>news:422f133f$XXXX@XXXXX.COM...
>>
>>Thank you, Alain.
>>I already cleared the USERNAME parameter in the BDE admin parameters, in
>>both places: (the "Database" tab) and the parameters for the native BDE
>>MS SQL driver (the "Configuration" tab).
>>
>>However, I don't understand how I need to open a Windows domain session
>>on
>>the client.
>>If I use ISQL, I am able to connect as Windows authentication without
>>any
>>issues.
>>Can be the problem related with version of MS SQL? I am using MS SQL
>>2000.
>>Thank you in advance, Marina
>>
>>"Alain Quesnel" <XXXX@XXXXX.COM>writes:
>>>You have to clear the USERNAME parameter in the BDE admin parameters,
>>>both
>>>for your alias (the "Database" tab) and the parameters for the native
>>>BDE
>>>MS SQL driver (the "Configuration" tab).
>>>
>>>Also, for a trusted connection to work, you need to open a Windows
>>>domain
>>>session on the client, and grant database access to that Windows domain
>>>user
>>>account on your MS SQL server.
>>>
>>>--
>>>
>>>Alain Quesnel
>>>XXXX@XXXXX.COM
>>>
>>>www.logiquel.com
>>>
>>>
>>>"marina davydova" <XXXX@XXXXX.COM>writes
>>>news:422df5f9$XXXX@XXXXX.COM...
>>>>
>>>>Thank you Dennis,
>>>>but creating ODBC connection is not preferable way.
>>>>Do you know if that can be achived with native MS SQL
>>>>
>>>>Dennis Passmore <>writes:
>>>>>I think you will have to ensure that the TDatabase object is
>>>>>connectioning
>>>>>using the "Sql
>>>>>Server" ODBC driver and not the "MS SQL" SqlLinks driver. Next in the
>>>>>ODBC
>>>>>administrator on
>>>>>each client the Trusted connection must be enabled, this is just a
>>>>>registry entry so you
>>>>>should be able to handle in code at runtime. After that just setting
>>>>>the
>>>>>Username/Password
>>>>>to be blank should be all that is required.
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>
>

 

Re:Trusted Connection to SQL 2000 thru BDE

"marina davydova" <XXXX@XXXXX.COM>writes
Quote

Alain, I can connect to database using Microsoft Query Analyzer with
Windows authentication without any problem. However, if I tried to connect
from BDE database set-up, I still was prompted
Quote
tto enter user name and password. Ileft those fields blank and
recieved error messega: "Login failed for user ('Null') Reaseon - not
assotiated with trusted connection.
Marina,
Change (or add) a Named Pipes (vs. TCP/IP) connection to your database
using Microsoft's Client Network Utility.
Good luck
 

Re:Trusted Connection to SQL 2000 thru BDE

Bill,
I did it already thru utility which comes with MS SQL and it did not help. What is strange, that when I created BDE database to connect to MS SQL 6.5 (which is also installed on my PC), the Trusted connection was fine. Now I am thinking that the issue could be related with the fact that I have both versions (6.5 and 2000) on the same PC. BDE was installed long time ago when I had only version 6.5. If I go to BDE Admin - Databases and do right click on the database which is SQL 2000, then select dbVer, it shows me client configuration dialog from MS SQL 6.5 version. I understood that BDE looks specifically for the file WINDBVER.EXE which is SQL 6.5 set-up utility.
Could you let me know:
1 - which version of MS SQL are you using
2 - do you have both versions installed on your PC
3 - what dbVer shows on your PC
Appreciate your help very much, I must resolve the issue and I am stuck!!! Please help
"Peds" <XXXX@XXXXX.COM>writes:
Quote
"marina davydova" <XXXX@XXXXX.COM>writes
news:422f8e4a$XXXX@XXXXX.COM...
>
>Alain, I can connect to database using Microsoft Query Analyzer with
Windows authentication without any problem. However, if I tried to connect
from BDE database set-up, I still was prompted
>tto enter user name and password. Ileft those fields blank and
>recieved error messega: "Login failed for user ('Null') Reaseon - not
assotiated with trusted connection.

Marina,

Change (or add) a Named Pipes (vs. TCP/IP) connection to your database
using Microsoft's Client Network Utility.

Good luck


 

Re:Trusted Connection to SQL 2000 thru BDE

Marina,
I use MS SQL 2000 in an environment with both BDE and ADO. I have never seen
setting the Alias in Microsoft's Client Network Utility
(Start->Programs->Microsoft SQL Server->Client Network Utility->Alias tab)
not work for trusted connection on any of our machines (Win2K and XP). The
BDE MS SQL alias SERVER NAME must match the alias name in the Client Network
Utility and the user name must be blank in both the BDE alias and the MS SQL
configuration (BDE Administrator->Configuration
tab->Drivers->Native->MS SQL).
If that is not working on your machine, can you try it on another machine?
Is there any way to not use the BDE? Microsoft has depreciated it is DBLib
(which the BDE uses) in favor of ADO (OLE-DB).
community.borland.com/article/0,1410,28688,00.html
community.borland.com/article/0,1410,10359,00.html
community.borland.com/article/0,1410,19694,00.html
support.microsoft.com/default.aspx
krf
"marina davydova" <XXXX@XXXXX.COM>writes
Quote

Bill,
I did it already thru utility which comes with MS SQL and it did not help.
What is strange, that when I created BDE database to connect to MS SQL 6.5
(which is also installed on my PC), the Trusted connection was fine. Now I
am thinking that the issue could be related with the fact that I have both
versions (6.5 and 2000) on the same PC. BDE was installed long time ago when
I had only version 6.5. If I go to BDE Admin - Databases and do right click
on the database which is SQL 2000, then select dbVer, it shows me client
configuration dialog from MS SQL 6.5 version. I understood that BDE looks
specifically for the file WINDBVER.EXE which is SQL 6.5 set-up utility.
Quote
Could you let me know:
1 - which version of MS SQL are you using
2 - do you have both versions installed on your PC
3 - what dbVer shows on your PC

Appreciate your help very much, I must resolve the issue and I am stuck!!!
Please help
 

Re:Trusted Connection to SQL 2000 thru BDE

I am able to use trusted connections in a Delphi 7 - BDE application using the 'MS SQL'
driver as long as I enabled 'Named Pipes' as the 'default' protocal ( listed first ) in
the MS SQL Client Network Utility. If TCP/IP is listed first then it does not work.