[freetds] dblib question - handling bad login name/password from a user

Andy Cranston a.cranston at selwaymoore.com
Mon Apr 26 11:59:17 EDT 2004


Hello list,

I'm getting more comfortable using the dblib package to write C programs on
my Solaris machine (Solaris 8) to talk to MS Sql Server databases.

So far I have been using the syb_msg_handler and syb_err_handler code from
the following source distribution file:

  freetds-0.62.1/src/dblib/unittests/common.c

However I'd like to write my own handlers.  The main reason being to catch
an invalid login attempt via:

  dbproc = dbopen(login, DEFAULT_SERVER);

Instead of the program bombing out I'd like to be able to gracefully
reprompt for another username and password.

Am I right in thinking I need to amend the handler routines to do this?  If
so any suggestions on a "clean" way to do this.  If not is there another way
I can gracefully deal with a user entering a bad login name and/or password
in my application?

Thanks in advance.

Regards.

Andy Cranston.

________________________________________________________________________
This message has been checked for all known viruses by the Selway Moore
scanning service powered by MessageLabs. For further information and
statistics on current viruses visit http://www.messagelabs.com/stats.asp
________________________________________________________________________



More information about the FreeTDS mailing list