Just a quick question about a small problem I'm having with a flex app I'm creating.
Its my first time tying to create an app using a local database and I'm getting an error in my query.
private function emptyrow(eventObj:CloseEvent):void {
var stmt:SQLStatement = new SQLStatement();
id = datagrid_id.selectedItem.personid;
if (eventObj.detail==Alert.OK) {
stmt.sqlConnection = sqlConn;
stmt.text = "DELETE FROM person WHERE pers_id=".id;
stmt.execute();
retrieveData();
}
}
The error message I'm getting is – Access of possibly undefined property id through a reference with static type
any insight to what I'm doing wrong would help. Thanks!
Best Answer
You have to declare the id variable like so
Also notice that string concatenation is
+
not.
in AS