Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 101035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:41:37+00:00 2026-05-11T00:41:37+00:00

I’m still a newbie to Adobe Air/Flex, and still fairly new with SQL. I’ve

  • 0

I’m still a newbie to Adobe Air/Flex, and still fairly new with SQL.

I’ve downloaded this (http://coenraets.org/blog/2008/11/using-the-sqlite-database-access-api-in-air…-part-1/) code and have been looking over it and I’m trying to implement the same idea.

I think it’s just something stupid. I’m using Flex Builder. I made a new desktop application project, didn’t import anything.

I added a DataGrid object and bound it to an ArrayCollection:

I’m trying to make it so when the program initializes it will load data from a database if it exists, otherwise it’ll create a new one.

The problem is, when the application runs, the datagrid is empty. No column headers, no data, nothing. I’ve tried changing a whole bunch of stuff, I’ve used the debugger to make sure all the functions are being called like they’re supposed to. I don’t know what I’m doing wrong. I’ve compared my code to the before mentioned code, I’ve looked for tutorials on Google. Anyone know what I’m doing wrong?

<?xml version='1.0' encoding='utf-8'?> <mx:WindowedApplication xmlns:mx='http://www.adobe.com/2006/mxml' layout='absolute' width='672' height='446'     applicationComplete='onFormLoaded()'     title='iRecipes'>      <mx:Script>         <![CDATA[             import mx.collections.ArrayCollection;              private var sqlConnection:SQLConnection;             [Bindable] private var recipeList:ArrayCollection;              private function onFormLoaded():void             {                 sqlConnection = new SQLConnection();                 openDataBase();             }              private function openDataBase():void             {                 var file:File = File.userDirectory.resolvePath('recipes.db');                  sqlConnection.open(file, SQLMode.CREATE);                  if(!file.exists)                 {                     createDatabase();                 }                             populateRecipeList()             }              private function createDatabase():void             {                 var statement:SQLStatement = new SQLStatement();                 statement.sqlConnection = sqlConnection;                 statement.text = 'CREATE TABLE Recipes (recipeId INTEGER PRIMARY KEY AUTOINCREMENT, recipeName TEXT, authorName TEXT)';                 statement.execute();                  statement.text = 'INSERT INTO Recipes (recipeName, authorName) VALUES (:recipeName, :authorName)';                  statement.parameters[':recipeName'] = 'Soup';                 statement.parameters[':authorName'] = 'Joel Johnson';                 statement.execute();                  statement.parameters[':recipeName'] = 'Garbage';                 statement.parameters[':authorName'] = 'Bob Vila';                 statement.execute();             }              private function populateRecipeList():void             {                 var statement:SQLStatement = new SQLStatement();                 statement.sqlConnection = sqlConnection;                  statement.text = 'SELECT * FROM Recipes';                 statement.execute();                 recipeList = new ArrayCollection(statement.getResult().data);             }         ]]>     </mx:Script>      <mx:DataGrid dataProvider='{recipeList}'>      </mx:DataGrid> </mx:WindowedApplication> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T00:41:37+00:00Added an answer on May 11, 2026 at 12:41 am

    I just tried this out using your code. I made a change and removed the condition as I was getting errors about the table not existing.

     //if(!file.exists)  //{    createDatabase();  //} 

    This got the datagrid showing the correct info. I think that there is something wrong with the way you are initialising the database file. I’m having a look into it at the moment.

    Try using

    sqlConnection.open(file, SQLMode.CREATE); 

    instead, for opening the database.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.