views:

39

answers:

1
-(IBAction)EnterButtonPressed:(id)sender
{ 
const char *sql = "SELECT AccessCode FROM UserAccess";
double result = ([Password.text doubleValue]);
if(sql == result )
{
    NSLog(@"Correct");
}
else {
    NSLog(@"Wrong");
}
}
+1  A: 

The main thing you're doing wrong is not sending that SQL query to the database. You probably ought to add in some kind of WHERE clause too. And... well, there's quite a lot wrong with that code to be honest.

Donal Fellows
On a plus side, I now know the password is “SELECT AccessCode FROM UserAccess” (literally!)
Donal Fellows
thanks donal .. noob here ... Sorry AccessCode was the column name lets say the password is 12345 .. thats what I want to extract from AccessCode FROM UserAccess ( the table )
Your first step is to get that DB query happening. To do that, you're going to have to use the SQLite C API. Google for an example; the top hit for "iphone sdk sqlite example" is highly informative. Then you'll need to consider what data you are storing, what you are looking up, etc.
Donal Fellows