Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Can't fetch row...
icon9.gif  Can't fetch row... [message #14287] Thu, 21 February 2008 18:09 Go to previous message
indiocolifa is currently offline  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

 
Read Message icon9.gif
Read Message
Read Message
Previous Topic: PostgreSQL Session.Open Leak??
Next Topic: How to save the DB data to another SQLite db file in HomeBudget?
Goto Forum:
  


Current Time: Sun May 19 05:12:55 CEST 2024

Total time taken to generate the page: 0.01436 seconds