NilObjectException -- why!?

[code]
sql = “SELECT us.intID, us.strFirstName, us.strLastName, us.strCompany FROM [userSettings] us”
'System.DebugLog CurrentMethodName + " :: " + sql
dim rs as RecordSet = dbDatabase.SQLSelect(sql)

IF rs.BOF THEN
  ' ## FALSE:
  data.lblProRankUserData.text = "No name"
  'System.DebugLog CurrentMethodName +  " :: FALSE -- NO POST"
ELSE
  ' ## TRUE:
  data.lblProRankUserData.text = rs.Field("us.strFirstName").StringValue + " " _
  + rs.Field("us.strLastName").StringValue
  
  'System.DebugLog CurrentMethodName +  " :: TRUE -- POST"
  
  
END IF[/code]

rs.Field(“us.strFirstName”).StringValue

?? Is this at all valid code!?

try to use “strFirstName” instead of “us.strFirstName” ?

Yes, I know… But I want to connect more tables to the SQL question. If there were ONLY this one, then, it’s fine…

But it’s not.
Cant SQLite handle shortcuts!?

sql = "SELECT us.intID, us.strFirstName, us.strLastName, us.strCompany " _ + ", c.intName "_ + " FROM [userSettings] us, [country] c "_ + " WHERE c.intID = us.intCountryID"

Maybe this one makes more sense!?
You see, where we’re heading…?

By default, the database returns only the column name. Use AS to differentiate the columns.

Select us.strFirstName AS us_strFirstName, us.strLastName …

Thanks… Yes, I should have known!
Why am I not impressed!?

sql = "SELECT us.intID AS us_intID, us.strFirstName AS us_FirstName , us.strLastName AS us_LastName, us.strCompany AS us_Company " _ + ", c.intName AS c_Country "_ + " FROM [userSettings] us, [country] c "_ + " WHERE c.intCountryID = us.intCountryID"

Where is the obvious error in this code??

There is no obvious error in what you posted. Dig a little deeper. Simplify until it works, then work backwards from there.

Thank you! It’s a progress!!

sql = "SELECT us.intID AS us_intID, us.strFirstName AS us_FirstName , us.strLastName AS us_LastName, us.strCompany AS us_Company " _ + ", c.[b]intName[/b] AS c_Country "_ + " FROM [userSettings] us, [country] c "_ + " WHERE c.intCountryID = us.intCountryID"
strName it is!
Thank you for advice!

Just fyi, examining dbDatabase.ErrorMessage would have told you that immediately. You would have gotten an error message like, “no such column intName”. Always test dbDatabase.Error and examine dbDatabase.ErrorMessage if it is true, after EVERY SQLSelect and SQLExecute.

I do not know if EXPLAIN (EXPLAIN) can be useful here.

I think I used it years ago and was happy to read the returned text.