Board index » delphi » MSSQL Trusted Connections

MSSQL Trusted Connections

Hi
Can you pass a parameter from TDatabase to a MS SQL Server so that
Trusted Connections can be used ?  (Server set up only to accept Trusted
Connections)

Sending

USERNAME=
PASSWORD=

doesn't work

Thanks

--
Tony Taddeo
Smartsoft (Australia) Pty Ltd
PO Box 3002 Norwood South Australia 5067
tel: +61 8 8361 2666 fax: +61 8 8364 4760
http://www.smartsoft.com.au  mailto:t...@smartsoft.com.au

 

Re:MSSQL Trusted Connections


As I understand trusted connections, you should not be passing parameters at
all. User Name = would clear out the data.  Try just connecting with out the
values in the Param list.
I have not done this but it should work.

Quote
Tony Taddeo wrote in message <351A1E5A.C4F27...@smartsoft.com.au>...
>Hi
>Can you pass a parameter from TDatabase to a MS SQL Server so that
>Trusted Connections can be used ?  (Server set up only to accept Trusted
>Connections)

>Sending

>USERNAME=
>PASSWORD=

>doesn't work

>Thanks

>--
>Tony Taddeo
>Smartsoft (Australia) Pty Ltd
>PO Box 3002 Norwood South Australia 5067
>tel: +61 8 8361 2666 fax: +61 8 8364 4760
>http://www.smartsoft.com.au  mailto:t...@smartsoft.com.au

Re:MSSQL Trusted Connections


Tony Taddeo D??? ???Y?? <351A1E5A.C4F27...@smartsoft.com.au> ...

USERNAME=<1 or several SPACE>
PASSWORD=<EMPTY>

Quote
>Hi
>Can you pass a parameter from TDatabase to a MS SQL Server so that
>Trusted Connections can be used ?  (Server set up only to accept Trusted
>Connections)

>Sending

>USERNAME=
>PASSWORD=

>doesn't work

>Thanks

>--
>Tony Taddeo
>Smartsoft (Australia) Pty Ltd
>PO Box 3002 Norwood South Australia 5067
>tel: +61 8 8361 2666 fax: +61 8 8364 4760
>http://www.smartsoft.com.au  mailto:t...@smartsoft.com.au

Re:MSSQL Trusted Connections


On the same topic, is there a way for Delphi to extract the current user
name from the environment?
--
Tony Lavelle
Hyrax Computer Systems Ltd, UK
t...@hyrax.co.uk
(remove .spamtrap from return address before replying)

Re:MSSQL Trusted Connections


Do not pass the PASSWORD Parameter.  To test,
create a visible DB component
double click to see parameters
click on the driver (not alias) and select SQL Server.
Click the defaults and all the variables should appear.
Remove the parameter for the password.
Change the Database Name and user Name and ODBC DSN
Save this and change the connected to true in the Object Prop.
Good Luck.

Quote
Alexander Miachin wrote in message <6fqbkj$4...@forums.borland.com>...

>Tony Taddeo D??? ???Y?? <351A1E5A.C4F27...@smartsoft.com.au> ...

>USERNAME=<1 or several SPACE>
>PASSWORD=<EMPTY>
>>Hi
>>Can you pass a parameter from TDatabase to a MS SQL Server so that
>>Trusted Connections can be used ?  (Server set up only to accept Trusted
>>Connections)

>>Sending

>>USERNAME=
>>PASSWORD=

>>doesn't work

>>Thanks

>>--
>>Tony Taddeo
>>Smartsoft (Australia) Pty Ltd
>>PO Box 3002 Norwood South Australia 5067
>>tel: +61 8 8361 2666 fax: +61 8 8364 4760
>>http://www.smartsoft.com.au  mailto:t...@smartsoft.com.au

Re:MSSQL Trusted Connections


User name that is Logged in? here is a piece of code the get the network
name and computer name. The name of the user is  not the windows name.  The
windows name is just something like getnetname.

const
  MAX_USERNAME_LENGTH = 50;
var
  vsize : integer;
 vUname : ShortString;
 vCname : ShortString;
 vEDesc : shortString;
 vNetProv : shortstring;
 vUSerName : string;
 errorcode : longint;

begin
   vsize := 50;
  GetComputerName(@vCname[1],vsize);
  vComputerName := strpas(@vCname[1]) ;
  vsize := MAX_USERNAME_LENGTH;
  errorcode := WNetGetUser(nil,@vUname[1],vsize);
    If errorcode = NO_ERROR then
    begin
    vUserName := strpas(@vUname[1]);
    end

Quote
Tony Lavelle wrote in message ...
>On the same topic, is there a way for Delphi to extract the current user
>name from the environment?
>--
>Tony Lavelle
>Hyrax Computer Systems Ltd, UK
>t...@hyrax.co.uk
>(remove .spamtrap from return address before replying)

Other Threads