Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 02-20-2010, 02:39 AM   #1
Registered User
Join Date: Feb 2010
Posts: 1
Default Error #1009

I'm working on an AIR app that creates a local database and allows the user to add/edit/delete data into the database. I can get it to add the data, but when I try to delete a row from the db based on the selected item in a datagrid (dg_clients) I get Error #1009: Cannot access a property or method of a null object reference.

Here's the code for the delete function, which is called by clicking a button:

private function deleteClient(eventObj:CloseEvent):void
var stmt:SQLStatement = new SQLStatement();

var selected_client:String = dg_clients.selectedItem.clientid;

if (eventObj.detail==Alert.OK) {
stmt.sqlConnection = sqlConn;
stmt.text = "DELETE FROM clients WHERE clientid=" + selected_client;

<mx:Button x="809" y="10" label="Delete" click='Alert.show("Delete this Client?", "Delete Client", Alert.OK | Alert.CANCEL, this, deleteClient, null, Alert.OK);'/>

any help would be greatly appreciated!

Last edited by perplexia; 02-20-2010 at 03:04 AM.
perplexia is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 09:12 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.