Abhilash Muthuraj
Abhilash Muthuraj

Reputation: 2028

flex not importing SQL based connections?

I'm trying to include a database un flex4 (flashbuilder) project, i don't see data and SQL packages in the import? What might be the reason? Should i add external library?

        import flash.data.SQLConnection;
        import flash.data.SQLStatement;
        import flash.events.SQLErrorEvent;
        import flash.events.SQLEvent;

Description Resource Path Location Type 1172: Definition flash.data:SQLConnection could not be found. EyeVision1.mxml /EyeVision1/src line 28 Flex Problem

Upvotes: 1

Views: 1121

Answers (2)

michael
michael

Reputation: 1160

You can connect the database directly from flex but this is not recommended because of the security reason.

You may try asSQL to do so.

Have a look on the following question:

Connecting any database directly from flex

Upvotes: 0

RIAstar
RIAstar

Reputation: 11912

You can use those classes only in an AIR project, not in a web-based Flex project. AIR comes packaged with a SQLite database to which you can connect using these classes.

A Flex web-based application runs on the client not on a server, so if you want to access a database on the server you'll have to use a server side language to do it and pass the results to the Flex app on the client side. If you want to access a local database, well... you can't (except perhaps using HTML5 local storage and ExternalInterface).

Upvotes: 3

Related Questions