Posted by Tonic in SWF Studio V3 on Feb 20 2008, 06:38 am

Hello,

I work on applications requiring the management of many data.
These data must be structured. In this context, i think that this management of data must be made by a database embedded.

I try to use SQLite with Flex application (with sqllite class + sqlhelper.exe + file system plugin), and it's run good.
But I think that sqlite is can be not rather complete to make all that I would want.

Thus I look embedded database which would allow to make more operations and completely standalone.
I try to use mysql embedded database, as this : http://www.northcode.com/forums/showthread.php?t=7831&highlight=mysql

But if i understand correctly, it is compulsory to have the good driver installed in the OS (MySQL ODBC 3.51 Driver).
So is not really a standalone database...?
here is a mean to not need to use this driver?

Exist others embedded database that we can use with swfstudio?

Thank you for your advice :)


Posted by AGo in SWF Studio V3 on Feb 20 2008, 09:35 am

yes, that's the downside of mySQL, you need a running server.

Another option for you would be using an MSAccess database (or any other DB which can be accessed by ADO), but that is not really standalone as well, as it relies on ADO and the JET drivers, which need to be installed.

Is there any specific problem/function you need that the current sqlite connector can not offer you?

As you can see in my forum section I promised an allnew SQLite plugin for like late last year, but a few drawbacks put my plans on hold.
However I am back on track now and hope to have at least an early beta (well, actually more a proof-of-concept) ready til april which will actually only contain two or three core commands to test the technology and the new features which can not be emulated with the current connector. If the current connector is missing specific functionality for you chances may be good that that feature will make it into the new plugin ;)


Posted by Tonic in SWF Studio V3 on Feb 21 2008, 09:16 am

Thanks for your response :)

Maybe Sqlite is too much lite.

I make tests for the moment.

I success to access on mysql database, but I try firebird server, and I don't success to access to database.

My code :


var obj  : Object = ssCore.ADO.setConnectString({connectString: "DRIVER=Firebird/InterBase(r) driver;UID=sysdba;PWD=tonic;DBNAME=C:\YELLOWARE.FDB;"},{sync:true});  
addTextDebug(obj.toString())
var qry :String = "INSERT INTO PERSON VALUES('test','Test')";
ssCore.ADO.setSQL({sql:qry},{sync:true});
ssCore.ADO.open({}, {callback:'onOpenFinishedFireBird',scope: this});

public function onOpenFinishedFireBird(return_obj : Object, callback_obj : Object, error_obj: Object) :void 
{
       addTextDebug("onOpenFinishedFireBird");
       if (return_obj.success) 
       {
          addTextDebug("succes");
         } else {
      addTextDebug('ERROR - '+callback_obj.callback+' : '+error_obj.description);
   } 
}

//Display : "ERROR - onOpenFinishedFireBird : null"


I don't understand my error. I think the connection string is okay ( http://www.connectionstrings.com/?carrier=firebird ), and the next part is the same as Mysql.
My odbc driver is installed and configured correctly...

Do you see an error?

Thanks :)


Posted by AGo in SWF Studio V3 on Feb 21 2008, 09:36 am

You need to escape the \ char, since you are using it in a string literal.
So change "C:\YELLOWARE.FDB;" to "C:\\YELLOWARE.FDB;"

btw, the "lite" in SQLite only stands for the lightweight engine, not the SQL language it supports. Actually it even has features (e.g. Triggers) that mySQL introduced a lot later.


Posted by Tonic in SWF Studio V3 on Feb 21 2008, 10:00 am

Oh yes, thanks lot Ago :)

Now it run good.

But I have to simulate the "COMMIT" command to save the sql execution.


SQL> commit;


Is it possible ?


Posted by AGo in SWF Studio V3 on Feb 21 2008, 10:10 am

You mean using ADO? I can't see a reason why using transactions should not work, as long as the underlying database enginge supports it (I have no experience with Firebird)

If you are talking about SQLite, this is from the help file on the query command of the connector, where "singleTransaction" is an optional
parameter:

QUOTE:

You should use "singleTransaction" whenever possible. It will increase the speed of the transaction up to 500% sometimes, especially on INSERTs and UPDATEs. See http://www.sqlite.org/cvstrac/wiki?p=PerformanceTuning#trans for more details.
However, the default is false because it can break some commands,
including some dot-commands.
It has the same effect as including your commands in a
BEGIN TRANSACTION;
...
COMMIT TRANSACTION;
shell.


Posted by Tonic in SWF Studio V3 on Feb 21 2008, 11:00 am

Oh yes, you have reason.

I can launched benchmark to sqllite, mysql, firebird, and assql... :)


Posted by Tonic in SWF Studio V3 on Feb 21 2008, 12:37 pm

It's impossible to make benchmark on the sqlite database because sur sqlite connector is for evaluation...

??


Posted by AGo in SWF Studio V3 on Feb 22 2008, 05:39 am

If you (or anyone else who is interested) fire me off a PM with your real name, company name and email address I can send you a timelimited sqlhelper, which will work just as the full version (without the nag dialog) but only for like 30 days, after that time it will stop working at all.

How does that sound to you?


Posted by Tonic in SWF Studio V3 on Feb 22 2008, 10:09 am

Do you think it's possible to communicate with swf and firebird data base without use a odbc driver. A direct communication with sockets... ?


Posted by AGo in SWF Studio V3 on Feb 22 2008, 10:16 am

Honestly I have no idea if that would work (as said I have never worked with Firebird) but even if it is possible it would be a real pain for sure.
Sockets are pretty lowlevel, that's the point in writing higher level wrapper drivers such as ADO ;)


Posted by Tonic in SWF Studio V3 on Feb 22 2008, 10:58 am

Yes but the big problem with ADO, it's that it's necessary to have a odbc driver to communicate with a database.
With socket communication, we have not need driver. So embedded database is a totaly standalone batabase with socket communication.

Look a this : http://maclema.com/assql/

I would like that, but with a firebird database.


Posted by northcode in SWF Studio V3 on Feb 22 2008, 01:19 pm

This is from the README_embedded.txt file from the documentation for the embedded Firebird

QUOTE:
Client access can be only via the local protocol, i.e. NOT a TCP/IP connection string that includes the server name "localhost" or IP address 127.0.0.1.

The embedded server supports only the local connect to a database file path without a server name. The lient program gets an exclusive access to the database file after successful connect.


There are some additional limitations related to the configuration and deployment that you should probably look at (README_embedded.txt) before choosing the embedded Firebird solution.


Posted by Tonic in SWF Studio V3 on Feb 25 2008, 12:32 pm

Yes, i read that.

But it's not a problem.

What is "Client access can be only via the local protocol, i.e." ?

I configured for embedded db like that : http://www.firebirdsql.org/manual/ufb-cs-embedded.html

I try to connect with that :


var str : String = "Database=C:\\Users\\Tonic\\Desktop\\app_2_0\\test.fdb;ServerType=1;";
var obj  : Object = ssCore.ADO.setConnectString({connectString: str},{sync:true});


But it not work...

Do you see an error?

Thanks.


Posted by northcode in SWF Studio V3 on Feb 25 2008, 01:03 pm

It's not clear to me (at least from the info on that page) that you can use the ADO driver with the embedded version of the database. It looks like you have to program against the DLL. I'm happy to be wrong, but I just don't know without reading more and doing some tests.


Posted by Tonic in SWF Studio V3 on Feb 26 2008, 03:18 am

With the ODBC driver, it works good. But I would like to have a databse standalone, who have don't need a driver, just use a dll to access to the database. Do you think it's possible with the ADO plugin?

The explication to have an embedded database with firebird :

QUOTE:

To make your application work with the embedded server:

1.

Copy fbembed.dll into your application directory. Rename it to fbclient.dll or gds32.dll, depending on what your application expects as a Firebird client filename. Many applications still look for gds32.dll. Firebird command-line tools like isql and gbak - which you can also run against the embedded server - want fbclient.dll. You can also make copies with both names.
2.

Also copy firebird.msg and ib_util.dll to your application directory. Copy aliases.conf if your application uses aliases to connect. The configuration file firebird.conf is only needed if you want to change the Firebird root directory; this will be discussed later.
3.

For Firebird 2 or higher, copy the icu*.dll libraries too.
4.

From the intl and udf directories, copy whatever your application or databases may need to same-named folders under your application directory.
5.

Now if you run your application it will use the embedded server DLL to connect to any local database you desire, provided that the Windows user who runs the application has sufficient access rights to the database file(s) in question! Any combination of user name and password is accepted, as long as neither is an empty string (a space is OK though).



Thanks :)


Posted by Tonic in SWF Studio V3 on Feb 28 2008, 04:03 am

Up :)

Do you think it's possible to connect embedded db with dll, not with ODBC Driver:


var str : String = "Database=C:\\test.fdb;ServerType=1;";
var obj  : Object = ssCore.ADO.setConnectString({connectString: str},{sync:true});


With this configuration : http://www.firebirdsql.org/manual/ufb-cs-embedded.html


Posted by northcode in SWF Studio V3 on Feb 28 2008, 04:37 am

No. When you use SWF Studio's ADO plugin you're using Microsoft ActiveX Data Objects. The ADO driver for the database you want to use has to be installed and registered so ADO can find it. The embedded solution for FireBird doesn't install (or require) the ADO drivers. If you want to use FireBird embedded I believe you're going to have to use the DLL directly, which in SWF Stuidio means writing a plugin.


Posted by Tonic in SWF Studio V3 on Feb 28 2008, 09:15 am

Arf.

So, it's not possible to communicate with embedded db using a dll, not odbc driver?