Re: [gnome-db] calling gda_client_find_connection twice with null username/passwords combos



On Thu, 2004-08-19 at 01:28 +0800, Alan Knowles wrote:
> Are you sure you dont want to do
> username ? username : dsn_info->username
> password ? password : dsn_info->password
> 
if we do so, we are setting the username and password to the same as the
already opened connection, which is not what we want. We want to find a
connection with the same dsn/user/password as passed in the arguments.

> rather than
> username ? username : ""
> password ? password : ""
> 
> so that if you send it null, it compares the user/pass combo form the 
> dsn, rather than null against it?
> 
that's why I add the "", to compare "" instead of NULL.

> I presume tmp_usr will have the username from the original dsn, rather 
> than null from the original connection?
> 
you are right on this, we should be doing:

	tmp_dsn = dsn ? dsn : gda_connection_get_dsn (cnc);
        tmp_usr = username ? username : gda_connection_get_username
(cnc);
        tmp_pwd = password ? password : gda_connection_get_password
(cnc);

This is now in CVS. Let me know of any other problem you see.

-- 
Rodrigo Moya <rodrigo gnome-db org>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]