Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Custom SQL Server Login Form

Discussion in 'Information Technology' started by DBG, Jul 28, 2006.

  1. DBG

    DBG
    Expand Collapse
    Guest

    I'm controlling the connections to my SQL Server through code. I'm trying to
    avoid saving the username and password in code however.

    It's easy for me to display my own login form, accept a username and
    password, and use those to reconnect my linked tables.

    However, I'm trying to figure out how to work around the problem of when a
    user enters an improper username and password. The system would then bring
    up the standard ODBC username and password dialog. I want to trap this, not
    display it and return to my form.

    -David
     
  2. Loading...


  3. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    Simply try yo open a connection using DAO/ADO with the supplied credentials
    If it fails return to your code...

    Pieter

    PS there is a parameter that will instruct the .dll how to react, the
    default (as per normal) is to prompt

    HTH

    Pieter

    "DBG" <DBG@discussions.microsoft.com> wrote in message
    news:93DE9D80-FDFC-4DC9-B2F3-4DB3FA441E41@microsoft.com...
    > I'm controlling the connections to my SQL Server through code. I'm trying
    > to
    > avoid saving the username and password in code however.
    >
    > It's easy for me to display my own login form, accept a username and
    > password, and use those to reconnect my linked tables.
    >
    > However, I'm trying to figure out how to work around the problem of when a
    > user enters an improper username and password. The system would then
    > bring
    > up the standard ODBC username and password dialog. I want to trap this,
    > not
    > display it and return to my form.
    >
    > -David
     
  4. DBG

    DBG
    Expand Collapse
    Guest

    When then tableDef.connect fails, I think its the ODBC connector which is
    passing the error message. Then when I ok that message I get the standard
    ODBC username and password prompt.

    So I'm not sure I can trap the error. Any idea where info about the .dll is?

    -David

    "Pieter Wijnen" wrote:

    > Simply try yo open a connection using DAO/ADO with the supplied credentials
    > If it fails return to your code...
    >
    > Pieter
    >
    > PS there is a parameter that will instruct the .dll how to react, the
    > default (as per normal) is to prompt
    >
    > HTH
    >
    > Pieter
    >
    > "DBG" <DBG@discussions.microsoft.com> wrote in message
    > news:93DE9D80-FDFC-4DC9-B2F3-4DB3FA441E41@microsoft.com...
    > > I'm controlling the connections to my SQL Server through code. I'm trying
    > > to
    > > avoid saving the username and password in code however.
    > >
    > > It's easy for me to display my own login form, accept a username and
    > > password, and use those to reconnect my linked tables.
    > >
    > > However, I'm trying to figure out how to work around the problem of when a
    > > user enters an improper username and password. The system would then
    > > bring
    > > up the standard ODBC username and password dialog. I want to trap this,
    > > not
    > > display it and return to my form.
    > >
    > > -David

    >
    >
    >
     

Share This Page