Board index » delphi » Help: Automatically Connect To SQL Server???

Help: Automatically Connect To SQL Server???

Hi

I want to automate the login to SQL Server 6.5 from a Delphi 2.0
application.  I can't seem to remove the connection prompt when the
application attaches to the database.

I have set the following in the TDatabase part with not affect.

        LoginPrompt := false
        Params: USER NAME=Woodland
                PASSWORD=woodland
                UID=WOODLAND
                PWD=woodland

It ignores this and continues to prompt me for a login.

Help!

Darryl

 

Re:Help: Automatically Connect To SQL Server???


In article <3342b6c6.3153...@news.mindlink.net>,
   darryl_ki...@mindlink.bc.ca (Darryl Kimak) wrote:

Quote
>Hi

>I want to automate the login to SQL Server 6.5 from a Delphi 2.0
>application.  I can't seem to remove the connection prompt when the
>application attaches to the database.

>I have set the following in the TDatabase part with not affect.

>    LoginPrompt := false
>    Params: USER NAME=Woodland
>            PASSWORD=woodland
>            UID=WOODLAND
>            PWD=woodland

>It ignores this and continues to prompt me for a login.

You need to set a name in the DatabaseName property, and then use that name
in the Database property of your queries. Probably you are getting the
queries associated with your database via the implicit database component
Delphi creates itself, which of course won't have any of its parameters set
like yours does.

--
Brad Aisa     web archive: http://www.interlog.com/~baisa/
email (anti-spam encoded): baisa"AT SYMBOL"interlog.com

"The highest responsibility of philosophers is to serve as the
guardians and integrators of human knowledge."   -- Ayn Rand

Re:Help: Automatically Connect To SQL Server???


Make sure the LoginPrompt property is false

Quote
Darryl Kimak wrote:

> Hi

> I want to automate the login to SQL Server 6.5 from a Delphi 2.0
> application.  I can't seem to remove the connection prompt when the
> application attaches to the database.

> I have set the following in the TDatabase part with not affect.

>         LoginPrompt := false
>         Params: USER NAME=Woodland
>                 PASSWORD=woodland
>                 UID=WOODLAND
>                 PWD=woodland

> It ignores this and continues to prompt me for a login.

> Help!

> Darryl

Re:Help: Automatically Connect To SQL Server???


Hi

I want to automate the login to SQL Server 6.5 from a Delphi 2.0
application.  I can't seem to remove the connection prompt when the
application attaches to the database.

I have set the following in the TDatabase part with not affect.

        LoginPrompt := false
        Params: USER NAME=Woodland
                PASSWORD=woodland
                UID=WOODLAND
                PWD=woodland

It ignores this and continues to prompt me for a login.

Help!

Darryl

Re:Help: Automatically Connect To SQL Server???


Quote
Darryl Kimak wrote:

> Hi

> I want to automate the login to SQL Server 6.5 from a Delphi 2.0
> application.  I can't seem to remove the connection prompt when the
> application attaches to the database.

> I have set the following in the TDatabase part with not affect.

>         LoginPrompt := false
>         Params: USER NAME=Woodland
>                 PASSWORD=woodland
>                 UID=WOODLAND
>                 PWD=woodland

> It ignores this and continues to prompt me for a login.

The two paramaters that you want are USER NAME and PASSWORD .TAhere
shouldn't be any spaces around the "=" sign. If you double click on the
TDatabase component and press the defaults button, it will fill in all
the necessary data with the correct spelling and capitalization. Don't
forget to uncheck the "login Propmt" option.

HTH
--

Robert Schieck
-----------------------------------------------------------------------
MER Systems Inc.   voice - 416-410-5166
                  fax    - 416-410-5167

Client/Server Development and Training using Delphi,  InterBase and
Oracle

home page            http://www.mers.com
InterBase page  http://www.mers.com/interbase.html
udflib page     http://www.mers.com/product.html
TDUG page       http://www.mers.com/tdug.html      -Toronto Delphi Users Group

Re:Help: Automatically Connect To SQL Server???


I am guessing that you may be getting the login prompt from SQL Server
itself, if you have set it up for standard security.  If you use set up SQL
Server to use integrated security (of course, this only works for Microsoft
SQL Server), then SQL Server is supposed to ignore whatever you have for
the USER NAME and PASSWORD parameters, and will use the workstation login.
If this is not the case, then ignore this message.  Let us know if you
eventually solve this problem.  Good luck.
Gene

Darryl Kimak <dKi...@intergate.bc.ca> wrote in article
<33453be7.102785...@news.intergate.bc.ca>...

Quote
> Hi

> I want to automate the login to SQL Server 6.5 from a Delphi 2.0
> application.  I can't seem to remove the connection prompt when the
> application attaches to the database.

> I have set the following in the TDatabase part with not affect.

>    LoginPrompt := false
>    Params: USER NAME=Woodland
>            PASSWORD=woodland
>            UID=WOODLAND
>            PWD=woodland

> It ignores this and continues to prompt me for a login.

> Help!

> Darryl

Re:Help: Automatically Connect To SQL Server???


Quote
Gene wrote:

> I am guessing that you may be getting the login prompt from SQL Server
> itself, if you have set it up for standard security.  If you use set up SQL
> Server to use integrated security (of course, this only works for Microsoft
> SQL Server), then SQL Server is supposed to ignore whatever you have for
> the USER NAME and PASSWORD parameters, and will use the workstation login.
> If this is not the case, then ignore this message.  Let us know if you
> eventually solve this problem.  Good luck.
> Gene

> Darryl Kimak <dKi...@intergate.bc.ca> wrote in article
> <33453be7.102785...@news.intergate.bc.ca>...
> > Hi

> > I want to automate the login to SQL Server 6.5 from a Delphi 2.0
> > application.  I can't seem to remove the connection prompt when the
> > application attaches to the database.

> > I have set the following in the TDatabase part with not affect.

> >       LoginPrompt := false
> >       Params: USER NAME=Woodland
> >               PASSWORD=woodland
> >               UID=WOODLAND
> >               PWD=woodland

> > It ignores this and continues to prompt me for a login.

> > Help!

> > Darryl
> >I have used the params below successfully (no more

param necessary)

SERVER NAME=myservername
USER NAME=myusername
PASSWORD=mypassword

Questions:

 Did not you forget 'SERVER NAME' ?

 Once prompted, do you login successfully ?

Re:Help: Automatically Connect To SQL Server???


Quote
Gene wrote:

> I am guessing that you may be getting the login prompt from SQL Server
> itself, if you have set it up for standard security.  If you use set up SQL
> Server to use integrated security (of course, this only works for Microsoft
> SQL Server), then SQL Server is supposed to ignore whatever you have for
> the USER NAME and PASSWORD parameters, and will use the workstation login.
> If this is not the case, then ignore this message.  Let us know if you
> eventually solve this problem.  Good luck.
> Gene

> Darryl Kimak <dKi...@intergate.bc.ca> wrote in article
> <33453be7.102785...@news.intergate.bc.ca>...
> > Hi

> > I want to automate the login to SQL Server 6.5 from a Delphi 2.0
> > application.  I can't seem to remove the connection prompt when the
> > application attaches to the database.

> > I have set the following in the TDatabase part with not affect.

> >       LoginPrompt := false
> >       Params: USER NAME=Woodland
> >               PASSWORD=woodland
> >               UID=WOODLAND
> >               PWD=woodland

> > It ignores this and continues to prompt me for a login.

> > Help!

> > Darryl
> >I have used the params below successfully (no more

param necessary)

SERVER NAME=myservername
USER NAME=myusername
PASSWORD=mypassword

Just in case...
Are you sure your login and password are correct ?

Have you tried removing UID and PWD ?

Other Threads