Home » U++ Library support » U++ SQL » Can't fetch row...
Can't fetch row... [message #14287] |
Thu, 21 February 2008 18:09  |
 |
indiocolifa
Messages: 49 Registered: January 2008 Location: Argentina
|
Member |
|
|
What I need is a user/pwd validation, my table is defined with the schema:
TABLE_(users)
SERIAL_ (id) PRIMARY_KEY
STRING_ (user, 30) NOT_NULL
STRING_ (realname, 30) NOT_NULL
STRING_ (passwd, 30) NOT_NULL
END_TABLE
The validation is:
void LoginWindow::BtnOkPush()
{
Sql sql(*(G_STATE->GetPsqlSession()));
sql*Select(SqlAll()).From(users)
.Where(user == (String)editLoginName.GetData()
&& passwd == (String)editPassword.GetData() );
if (!sql.Fetch())
Exclamation ("Incorrect pass and/or username.");
else
{
G_STATE->SetCurrentUser(String(sql[realname]));
PromptOK("Welcome [* " + String(sql[realname]) + "]");
}
}
The validation works in the sense that entering an invalid user/pwd combination displays the proper message. But when you enter data for a row that exists, the Welcome message appears without the name (I mean, seems that sql[realname] is empty!).
Any ideas?
P: How I can trace SQL execution?
[Updated on: Thu, 21 February 2008 18:10] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Sat Apr 26 14:26:33 CEST 2025
Total time taken to generate the page: 0.02566 seconds
|