Flex :: Remove Slashes From Sqlite

Dec 30, 2009

I am creating an application in Flex that uses an embedded SQLite database. The data in the database contains quotes and other special characters which are escaped using a backslash or ''.Before I retrieve the data and render it in a Flex text area control I want to remove the ''. Is there any function in Flex which can help me do this - some equivalent of stripslashes() in PHP?

View 1 Replies


Similar Posts:


ActionScript 3.0 :: RegExp - Remove The Leading And Following Slashes And Convert All The Other Slashes To Underscores

Nov 7, 2009

i'm trying to do a string replace with but can't seem to get the regular expression right. change "/portfolio/2/3/" to "portfolio_2_3"? Basically I want to remove the leading and following slashes, and convert all the other slashes to underscores.

View 2 Replies

Flex :: AIR SQLite IN Expression Not Working?

Mar 14, 2010

I'm having a problem with an expression in my sql statement in SQLite for Adobe AIR basically I have this sql = "UPDATE uniforms SET status=@status WHERE customerId IN(19,20)"; updateStmt.parameters["@status"] = args[1]; updateStmt.execute();

if I run the above code it works, updating the status when the id are 19 and 20

but if I pass the ids list as a parameter like this

sql = "UPDATE uniforms SET status=@status WHERE customerId IN(@ids)";
updateStmt.parameters["@status"] = args[1];
updateStmt.parameters["@ids"] = "19,20";
updateStmt.execute();

it gives me and error, saying could not convert text value to numeric value, which make sense because I'm passing and string but the IN expression should convert it accordingly, like it does when I pass directly the list values, why is not working the other way,

View 1 Replies

Flex :: Web App Access A Sqlite Database?

Nov 16, 2010

I'm making an application (web based) using flex and i have a requirment to access the SQLite database on the local system. There is no server running and i've decided to give them the link to the html file and see how that works out.

So in the root directory, there will be all required swf, html files, etc and a .db file. Can i access that database thro the flex web application ?

View 2 Replies

Flex :: Querying SQLite Database With AIR App

Dec 13, 2010

I have been struggling with trying to interface with SQLite and Adobe AIR. I am using the Flex 4 SDK with AIR 2.0. I modified code from a tutorial by David Tucker on InsideRIA ([URL]). I am writing in FlashDevelop (which I suppose could be my problem), and I can compile and run the app. The issue is that when I go to search the db file, I always get some error which results in the 'BREAKER' trace (ie - the 'queryError' function is called). I have tried simply running the SQL command on the db and it works fine, so there is an issue somewhere in the way Flex or AIR is handling my query (or obviously I could have made a mistake in coding).

[Code]....

View 1 Replies

Flex :: Encrypting An Unencrypted SQLite Db?

Aug 26, 2011

This link: [URL] has an interesting class to do just that! Encrypt an unencrypted database: but I'm having difficulty with a few things: You can find where the author, @probertson! Now I've got the following error: Compiler Error: Error #2044: Unhandled error:. text=Error #3125: Unable to open the database

Let me start by saying the source file works, since I've been using it (and the path) in another application. The error arises in the call to attach the source db to the newly created db.

View 1 Replies

Flex :: Cannot Write To Sqlite Db In Packaged Air

Jan 18, 2012

I can write to db when running in IDE(FB), while after packaging a air, the app wont write to sqlite db, Why?

View 2 Replies

Flex :: SQLite Display SUM() Result?

Mar 21, 2012

I try to display the Total sum() from a sqlStmt but all i got is [object, object], any idea how?

private function displayAmountHeading():void {
sqlStmt = new SQLStatement();
sqlStmt.sqlConnection = sqlConn;
sqlStmt.text = "SELECT SUM(Amount) FROM MainTable";
sqlStmt.execute();

[Code]...

View 2 Replies

Flex :: Sqlite - Saving A File In Flex Air?

Aug 15, 2010

I'm trying to copy my SQLite file that is used in my Air app to user's selected directory using

var fileSaveDest:FileReference = new FileReference();
fileSaveDest.save(dbWorkedFile,'Inventory.DB');
dbWorkedFile is a File
dbWorkedFile = File.documentsDirectory.resolvePath("Inventory.db");

I tried this but the saved file isn't a valid SQLite file. Also, I was wondering whether it's possible to embed SQLite to Air? If so how can I import and export the database?

View 2 Replies

Flex :: Putting SQLite Result Into ItemRenderer

Apr 12, 2012

Using the following SQLite statement:
SELECT Customer, SUM(OrderAmount) AS TotalOrder FROM OrdersTable GROUP BY Customer
I get the result of total sum (total order) of each customer. How can I put the above result into a itemRenderer label.text ?

<s:ItemRenderer>
<s:Label id="customerName" text=??? />
<s:Label id="totalOrder" text=??? />
</s:ItemRenderer>

View 2 Replies

Flex :: When Does Executing Return False In SQLite

Sep 7, 2009

I've read the flex language reference: [URL]. This property is true if execute() has been called and not all of the results have been returned from the database. However, I'm having trouble understanding what that means exactly. I keep receiving an error:
Error #3106: Property cannot be changed while SQLStatement.executing is true.

I've tried creating an event handler for SQLEvent.RESULT, my thinking was that's how the results would get returned from the database and therefore executing() would return false - didn't work. Does this mean i'm trying to change my SQLStatement variable too quickly? how long does the execute() function take?

The code in question:
private function fileProgress(p_evt:ProgressEvent):void {
var char:String;
var line:String = "";
var counter:int = 1;
sqlStatement = new SQLStatement();
[Code] ....

Stream is a filestream. I'm trying to read a textfile and put every line into a new sqlite table row. I've also tried using sqlStatement.parameters as an alternative way to do my insert queries, but to no luck. that throws a different error:
Error #3110: Operation cannot be performed while SQLStatement.executing is true.

View 3 Replies

Database :: Sqlite And Flex - Insert Into If Not Exists?

Feb 4, 2010

I'm using flex to develop my first desktop app and I'm working with sqlite for the first time as well. I'm creating my database and all the tables and I would also like to add a few rows of data into a couple of the tables so that the users have some data to work with on first install.

The only problem I'm having is every time I run the program it keeps inserting the same data over and over again. I'm just wondering if its possible to do a - INSERT INTO IF NOT EXISTS. or some other kind of work around.

View 2 Replies

Flex :: Query - Sqlite - Insert Into Or Ignore

Feb 5, 2010

I'm using flex to develop my first desktop app and I'm working with sqlite for the first time as well. I'm creating my database and all the tables just fine, but I would also like to add a few rows of data into a couple of the tables so the information is present on first install. The only problem I'm having is every time I run the program it keeps inserting the same data over and over again. here's what I'm trying, but it doesn't seem to be working.

[Code]...

View 2 Replies

Flex :: Writing Integration Tests For App Using SqLite?

Jun 28, 2010

I want to write integration tests for a Flex application using pureMVC architecture.The back-end is sqlite.

View 1 Replies

Flex 4 :: Create An Encrypted SQLite Database

Aug 26, 2010

How can I create and use an encrypted SQLite database for an AIR application, please?

View 1 Replies

Sql :: Flex 4: Binding Label To Dataprovider (SQLite)?

Feb 4, 2011

Let me start off by saying this is my first Flex project, so I've been reading a lot, learning a lot, but am still struggling to make this work. I am trying to display records from an SQLite database within my Flex mobile application. I have the input form saving data correctly to the database, and I have a datagrid that is outputting the records (so I can confirm everything looks good). However, my problem is making the data readable.

I want the user to be able to select an identifier from either a drop down or a list (even if it's just a 1 column datagrid), and have the labels to the right update to reflect that information.

[Code]...

View 1 Replies

Flex :: Improve The Performance Of The SQLite Database?

Apr 26, 2011

Background: I am using SQLite database in my flex application. Size of the database is 4 MB and have 5 tables which are

table 1 have 2500 records
table 2 have 8700 records
table 3 have 3000 records
table 4 have 5000 records
table 5 have 2000 records.

Problem: Whenever I run a select query on any table, it takes around (approx 50 seconds) to fetch data from database tables. This has made the application quite slow and unresponsive while it fetches the data from the table.

How can i improve the performance of the SQLite database so that the time taken to fetch the data from the tables is reduced?

View 3 Replies

Flex :: Display Images From Sqlite Into Datagrid?

Jun 12, 2011

I have a number of thumbnail images (8K ish in length), stored in a sqlite database, encoded as base64 strings.

I would like to retrieve these images and present them into a datagrid (along with some other information from the DB)

The retrieval of information from the database works, but I cannot quite "see" how to connect the decoded result from the database to the datagrid, to display the images.

Below is some code, where I show (to simplify things) a simply DGrid and want to use the dataprovider to point to the select from the DB[code]...

View 1 Replies

Flex Local SQLite BLOB Display?

Jul 29, 2011

I've got 3 columns in an SQLite db I built with Firefox's handy SQLite Manager. So, I created 3 columns, an index/reference that's just an incrementing INTEGER for easy reference, a descriptive title of the image (so it can be searchable later) in a TEXT, and a BLOB type that holds the pngs.

I'm trying to add this in an assets folder into my project (as a pre-populated database) and display the blob images, one at a time, in a window one after the other, scrollable by user. This is where I'm running into problems. Eventually I want to be able to encrypt it and add a search tool, but first things first, and that's displaying an image.

I have spent several hours scouring the web about this topic, but there isn't much help out there: Adobe has tips about using SQLite with AS3 (their reference documents and the support section of their website have some overview articles) but nothing refers to reading blob data in depth.

On this site, I've found some references to Adobe Air looking for extra byte information when reading blobs since they have a different syntax to write to the databases created within the program. See: What is the first bytes in a Blob column SQlite Adobe AIR? Blob Sizeinfo?

View 1 Replies

Flex :: Air Sqlite Date In YYYY/MM/DD HH:MM Format

Aug 24, 2011

While I was playing with Air Sqlite, I got some trouble in saving Date in the Database

INSERT INTO tblUserComments (comment_text, comment_cat,comment_date,parent_id) VALUES('"+bubbleText.text+"','"+chosenCat+"',DATETIME('now', 'localtime'),'"+_parentId+"')

store the comment_date in the following format

2455783.2596296296 instead of 2011/08/09 18:13.

How can I save the Date Data as YYYY/MM/DD HH:MM?

View 1 Replies

Flex :: Sqlite - Spark List With SQL Result

Nov 4, 2011

I'm trying to populate a spark list component from SQLite in an AIR application statusList = new ArrayCollection(statement.getResult().data); myList.dataprovider = statusList; From the debug session I know the data is structured as statusList->unnamed object->array

[Code]...

View 1 Replies

Flex 4.6 Mobile Sqlite Specific Data?

Mar 2, 2012

First off I am new to using Flex, but I have pieced this app together with help from online tutorials and information. Basically my app is like a directory of names, addresses and so forth, but I also have additional fields of "week" and "day". What I am trying to do is have a list that shows only the names of, for example Week 1 - Monday. Below is some of the code I am using to help you understand what I am trying to do.

<s:List dataProvider="{AddDoctorDatabase.doctors()}" labelField="name" change="onDoctorSelected(event)"
left="0" right="0" top="0" bottom="0"></s:List>

[Code]...

View 1 Replies

Flex :: Sqlite - Spark List With SQL Result?

Jan 26, 2005

statusList = new ArrayCollection(statement.getResult().data);yList.dataprovider = statusList;From the debug session I know the data is structured as statusList->unnamed object->array

<s:List width="100%" height="100%" id="listUploadStatus" dataProvider="{statusList}">
<s:itemRenderer>
<fx:Component>

[code].....

View 11 Replies

Flex :: SQLite Parameters - Not Allowing Tablename As Parameter

Aug 13, 2009

I'm developing an application in AIR via Flex, but I'm not seeing where I'm going wrong with SQLite (I'm used to MySQL). Parameters work, but only in certain instances. Is this part of the built-in sanitation system against sql injection?

Works:
sqlite
"INSERT :Fields FROM Category", where the parameter is :Fields = "*"
AS3
var statement:SQLStatement = new SQLStatement();
statement.connection = connection;
statement.text = "INSERT :Fields FROM Category";
statement.parameters[":Fields"] = "*";
statement.execute;
[Code] .....

View 3 Replies

Flex :: Getting Next Record In SQLite Database For Mobile Application?

Feb 27, 2011

I have a mobile application that uses an sqlite database. I cannot seem to figure out how to access the next record when the user presses the 'next' button. My database is using 'id' as primary key with autoincrement as integer.

private function nextMoveRPart(event:EffectEvent):void
{
var cardNumber:int = parseInt(cardNumberLabel.text);

[Code].....

View 1 Replies

Flex :: Passing Data From SQLite Db Into Specific Components?

Mar 25, 2011

I have an sqlite db in an application and am stuck on how to pass the data that is retrieved from the db into multiple textboxes. I can get the first selection passed into the components just fine, but my problem comes in when I try to pass a second data selection into a different textbox while keeping the data from the previous selection the same in the first textbox.Basically, the user selects a recipe and that recipe is passed into textbox 1 Then another recipe is selected and that recipe is passed into textbox 2. *The recipes are selected from a different view, if that adds anything to the problem. After being selected, the view is returned to where the textboxes are.I'm not looking for someone to code this for me, but rather on how I would do it. I should be able to do that. =)My Text Components

<s:Group id="group1" x="412" y="156" width="200" height="206" contentBackgroundAlpha="1.0" >
<s:TextInput id="tText1" x="22" y="30" width="157" height="25" fontSize="12"
text="{data.kTitle}"/>

[code].....

View 1 Replies

Actionscript 3 :: Flex 4.6 Counting Rows In Sqlite Table

Feb 4, 2012

I want to check there are no records in an existing sqlite table:[code]The customer table exists but is empty. While running it flex gives this error on result.length:Error #1009: Cannot access a property or method of a null object reference.

View 1 Replies

How Does Working With SQLite Databases Work In Flex 4.5.1 For Mobile Applications

Jun 26, 2011

How does working with SQLite databases work in Flex 4.5.1 for Mobile applications,I'm looking to create a general class that I can reuse. For now I only want it to handle queries and return results or fault events.Also, I am unsure if I should be using Synchronous or Asynchronous connections for mobile devices.

View 1 Replies

Flex :: Get Anytihng From SQLite To Render - Display Any Data - Even Text?

Aug 5, 2011

I am trying to get anytihng from my SQLite to render in Flex, and I can't figure out how to display any data, even text, in Flex. What am I doing wrong?

[Code]...

I've tried a number of different components, and I can't seem to get the data to bind properly (although this code finally doesn't have the dreaded "Data binding will not be able to detect assignments to... " message, or the other dreaded "Property undefined" message).

View 1 Replies

Flex :: Saving And Loading Image To Local SQLite BLOB ?

Sep 8, 2011

I need to be able to save and load images into an SQLite database using Flex 4.5 for a mobile application. The use case is this:

Inside the view there is a spark Image object with a URL as a source

When user clicks button, the Image is saved to an SQLite db inside a BLOB field.

In a separate Image, the source is set to the ByteArray stored in the db.

The biggest question so far is this: where do I get the ByteArray for a loaded Image? I've tried debugging and inspecting Image, BitmapImage, and BitMapData but there's no sign of the byte array.... perhaps it's inside the ContentLoader? But that's null unless I enable caching.

I've done some research and there are no complete examples for how to handle this. I've written a simple View that anyone can copy and paste into a new project. It will compile without errors and can be used for testing. I will update this code as I get the answers I need so that anyone can have a fully working example of this workflow.The only caveat: I used a synchronous connection to the DB to avoid complicating the code with event handlers, I wanted to keep it as simple as possible.I will only mark this question as answered once it is fully functioning both ways.

UPDATE SEPT. 09 2011: The code below is now fully functioning in both directions (save and load). Here are some of the things I've learned: It turns out that the ByteArray of a spark Image can be found inside the LoaderInfo of the image itself. Like this:

image.loaderInfo.bytes

However, trying to set this ByteArray as the source of another image ( image2.source = image1.loaderInfo.bytes) results in this security error: Error #3226: Cannot import a SWF file when LoaderContext.allowCodeImport is false.Which is too bad because it would save so much time and processing power.the workaround is to encode the ByteArray using either a JPEGEncoder or a PNGEncoder. I used the JPEGEncoder which produces much smaller files. Here's how:

var encoder:JPEGEncoder = new JPEGEncoder(75);
var imageByteArray:ByteArray = encoder.encode(imageToSave.bitmapData);

Now the problem is saving these bytes to the DB. Saving them as they are now will not work once we read them out, I'm not sure why. So the solution is to encode them into a base64 string like this:

var baseEncoder:Base64Encoder = new Base64Encoder();
baseEncoder.encodeBytes(imageByteArray);
var encodedBytes:String = baseEncoder.toString();

So now just save that string into the BLOB field and later read it out. However, you have to decode it from a base64 string to a ByteArray like this:

var encodedBytes:String = result.data[0].imagedata;
var baseDecoder:Base64Decoder = new Base64Decoder();
baseDecoder.decode(encodedBytes);
var byteArray:ByteArray = baseDecoder.toByteArray();

Now assign the bytearray as the source of your image and you're done. Simple right?if you find any optimizations or alternative ways to do this.I will respond and keep this code updated if need be.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved