import mx.controls.Alert;
package dbconfig // error line here
{
public class DBConn
{
private var dbConn:SQLConnection;
private var dbFile:File;
public function DBConn()
{
this.openConnection();
}
public function openConnection(){
dbFile = File.applicationStorageDirectory.resolvePath("accounting.sqlite");
dbConn = new SQLConnection();
try
{
dbConn.open(dbFile);
Alert.show("asdf");
}
catch(e:SQLError)
{
Alert.show("SQL Error Occured: ", e.message);
}
}
}
}
views:
27answers:
3
+2
A:
You need to place the import inside of the package definition:
package dbconfig
{
import mx.controls.Alert;
public class DBConn
{
private var dbConn:SQLConnection;
private var dbFile:File;
public function DBConn()
{
this.openConnection();
}
public function openConnection(){
dbFile = File.applicationStorageDirectory.resolvePath("accounting.sqlite");
dbConn = new SQLConnection();
try
{
dbConn.open(dbFile);
Alert.show("asdf");
}
catch(e:SQLError)
{
Alert.show("SQL Error Occured: ", e.message);
}
}
}
}
James Fassett
2010-05-20 15:57:14
thnx. Do you happen to know any CRUD examples tutorials for FLEX Air and sqlite. I've been building this application but i get stuck a lot on simple probelms. started flex only a few days ago so some tutorials on CRUD operations would help me a lot.
soden
2010-05-21 17:10:25
A:
Yes, unlike Java, you must import all classes you are going to use, even if you fully qualify them. Judging by the tags I assume you know this, but the SQLConnection and File are Air only, so wouldn't run in the normal flash player.
mezmo
2010-05-20 16:28:03
I've been building this application but i get stuck a lot on simple probelms. started flex only a few days ago so some tutorials on CRUD operations would help me a lot.
soden
2010-05-21 17:10:52
A:
crud and sqlite tutorial here: http://www.peterelst.com/blog/2008/04/07/introduction-to-sqlite-in-adobe-air/
Arpinum
2010-05-23 00:31:14