SQL Connection using AIR - AS3

Hi guys, I'm currently developing a mobile app that have to connect itself to a MySQL database.
Googoling I found this code:
import flash.filesystem.File;
import flash.data.SQLConnection;
import flash.data.SQLStatement;
import flash.net.Responder;
var connection:SQLConnection;
openDatabase();
function openDatabase():void
          var dbFile:File = File.applicationStorageDirectory.resolvePath("mySQL.db");
          connection = new SQLConnection();
          connection.addEventListener(SQLEvent.OPEN, onOpen);
          connection.openAsync(dbFile, SQLMode.CREATE);
function onOpen(SQLEvent):void
          var stat:SQLStatement = new SQLStatement();
          stat.sqlConnection = connection;
          stat.text = "CREATE TABLE IF NOT EXISTS contacts (id INTEGER PRIMARY KEY AUTOINCREMENT, fname TEXT, lname TEXT, phone INTEGER)";
          stat.execute(-1, new Responder(selectItems));
function selectItems(SQLEvent):void
          trace("Select items!");
But there's a problem!
Adobe Flash CS 5.5's compile gives me this error:  "Access to a null or undefined property SQLMode"
Is there anyone that can help me?
Thanks!!!
Brandon

SQLConnection and SQLStatement are for using a local SQLite database, not a remote MySQL database.  To get data out of a remote database, you need to call a service, which is written in a server-side language such as PHP, .Net, Java, ColdFusion, etc.
If you had a typo and actually meant a local SQLite database, then I can share some resource recommendations that helped me.
AIR SQLite: an optimization conversa by H. Paul Robertson
http://tv.adobe.com/watch/360flex-conference/air-sqlite-an-optimization-conversa-by-h-paul -robertson/
Working with local SQL databases in AIR
http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118676a5497-7fb4.html
Documentation
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/data/SQLConnectio n.html

Similar Messages

  • Sql Connection using jquery in HTML

     
       Hello friends.. . Sql Connection using jquery is possible ?
       If possible.. .pls tell the procedures and steps...
       pls clarify my doubt.. .

    jQuery has no helper functions for handling SQL.
    It has Ajax functions which can be used
    to talk to a web service that runs SQL on the server.
    Client side JavaScript doesn't have the ability to access raw
    sockets, so you can't connect directly to a remote database.
    There are various client side databases, including storage,
    which can be accessed directly with JavaScript (but jQuery doesn't have anything to interact with them).
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • SQL connection using "FREE" IP address

    we have a server running CF MX (6.1), making SQL requests to
    another server on the network.
    The strange thing is, when viewing the active connections on
    the SQL server, the CF server is listed using
    an unassigned IP address on the CF server.
    How does CF choose which IP address it uses for outbound
    connections,
    where multiple IP addresses are assigned to the NIC?

    From what you say in your post, it almost sounds like you have to change your Network setting to connect with ethernet for you to get a connection.
    The Airport Tab in the Network has to correspond with the type of connection you are using.
    It must be highlighted and the green dot showing and drag it to the top of the list.
    Then when you travel and use Wireless you can change it back to Airport and connect.
    Cheers Don

  • Running a Select query against multiple sql servers using SSIS script task.

    Hi Guys,
    I need to fetch data from multiple sql servers using  SSIS scirpt task inside a foreach container.
    is there anyway i can build dynamic sql connections using ssis variables inside SSIS script task in each loop
    Please guide me or refer any blogs so that i will try..
    Thanks in advance.

    Your only options is using .net code, then it will be no different than using a console app in a loop.
    using (SqlConnection connection = new SqlConnection(connectionString))
    connection.Open();
    Console.WriteLine("ServerVersion: {0}", connection.ServerVersion);
    Console.WriteLine("State: {0}", connection.State);
    and so forth for each connection string
    the connection string would come from the ForEach loop
    Arthur My Blog

  • SQL Connection does not repond?

    Hi,
    I have opened 25 SQL connection using (System.Data.SqlClient) in my service.When ever data is coming to the application ,it will take one connection and put entry to database(SQL Server 2008 R2).Sometimes the opened connections
    are not responding.i have put timeout property is 120 secs,but its not throwing any excepion also.once i restart the service then only ,it will work.How can i solve this issue?
    Thanks Regards R.Karthick

    Below link may be helpful,
    http://msdn.microsoft.com/en-us/library/8xx3tyca(v=vs.110).aspx
    Regards, RSingh

  • How do i connect to sql server using java?

    hi ever body
    i need to connect to sql server using java
    what is the driver i will use?
    thanks

    Microsoft make a jdbc driver and it is readily available through MSDN. Here is a link http://msdn2.microsoft.com/en-us/data/aa937724.aspx. Whatever jdbc driver you are looking for, Google it, and if it exists you'll find it in 10 seconds.

  • Can't connect to SQL Database using new login

    I can connect to Azure SQL Database using the admin ID created when I set up the Azure account.  Now I want to set up a different login that has only regular read/write privileges.  I have followed the instructions on several web posts, to create
    a login at the server level, then create a user at the database level from the login.  When I try to connect, though, the connection fails.  I get an error message, and a GUID that I am supposed to supply to MS tech support, except that all I have
    is a standard Azure subscription, which does not include tech support.
    Here is what I have done so far:
    Logging in to the server with the admin account with SQL Mgmt Studio, I go to the master database on my Azure server, and create the login:
    CREATE LOGIN clouduser@gxw8x04nlb with PASSWORD = 'xoxoxoxo';
    This appears to work (password supplied is a "strong" password), or at least it doesn't show any error response.
    Then, connecting to the production database in Azure, I set up a user and set permissions as follow:
    CREATE USER clouduser1 FROM LOGIN clouduser@gxw8x04nlb;
    EXEC sp_addrolemember 'db_datareader', 'clouduser1'
    EXEC sp_addrolemember 'db_datawriter', 'clouduser1'
    When I attempt to connect to Azure using the new login, however, I get an error message (from SQL Mgmt Studio as well as from MS Access).  I am using the SQL Server Native Client 10.0.
    The message is:
    Connection failed:
    SQLState '28000'
    SQL Server Error 18456
    [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'clouduser'.
    Connection failed:
    SQLState: '01000'
    SQL Server Error: 40608
    [Microsoft][SQL Server Native Client 10.0][SQL Server]This session has been assigned a tracing ID of
    '271851d5-8e94-497c-a332-d9d40682bb7a'.  Provide this tracing ID to customer support when you need assistance.
    Is there some missing step I need to do, to permit the login to see the database?  I have looked for such in the various discussions about connection problems, but have not been able to find such a thing.   Or extend more permissions to the new
    user? Or specify a default user ID for a given login ?  (as they do not have the same names, in the examples I have seen).  I tried making the user ID the same as the login (w/o the server name), but that didn't seem to help, either.
    I have done numerous web searches, and tried about every variation of login or user ID, password, etc. that I can think of, and all of them encounter the same error.  It's got to be something very simple - clearly Azure supports more than one login
    per database.  But's that's all I have at the moment.  That login connects just fine, but others won't, using the same PC, middleware, IP address, etc.
    Any help would be much appreciated -
    Thanks,
         Doug

    Olaf -
    I noticed that, but all of the examples I have seen have Users named slightly differently from the Logins.  I did try logging in with the Login name instead.  No good.  I tried making the Login and the User name the same (clouduser).  Also
    no good - same symptoms.
    I think the problem is that the initial creation of the Login needs to be done WITHOUT the server name on the end.  
    Logged in to the master DB, I tried:  Create LOGIN clouduser@gxw8x04nlb with PASSWORD = 'xoxoxoxo';
    That didn't give me an error message, but I think it created a LOGIN of 'clouduser@gxw8x04nlb'.  When
    referenced from the outside world, I would need to specify 'clouduser@gxw8x04nlb@gxw8x04nlb'.
    I tried deleting the logins, and then creating the login 'clouduser' in the Master DB.  Then in
    the application DB, I created User clouduser from LOGIN clouduser, and then assigned a role.  That seems to work!
    In my connection string, File DSN, etc. I still need to supply the login as 'clouduser@gxw8x04nlb'.
     But when I am logged in to the server, and working in the Master DB or the application DB, I just refer to the Login as 'clouduser'.  
    Seems a little more complicated than it really should be, but at least I now have something that works.
    Doug
    Doug Hudson

  • Error while connecting to external SQL table using BCS identity in SharePoint 2010

    Hi all,
    I am working on SharePoint Foundation 2010. I have a stand alone setup. Now I am trying to connect to a SQL table in another server. I have used SharePoint Designer to connect using BCS. I have selected "BCS Identity" for authenticating with SQL
    in the external content type. then I created a list with this external content type.
    I get the following error upon opening the external list.
    Login failed for user 'INYKGW\sp_farm'.
    I am confused. how do I solve this error.
    any help is greatly appreciated.
    Thanks.

    Hi letShare ,
    Whether the  account 'INYKGW\sp_farm' is current user account or a service managed account?
    Could you  please  provide detail error message of ULS log  to determine the exact cause of the error.
    For SharePoint 2010, by default, ULS log is at      
    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS
    Also please have a look at  the blog :
    http://www.wonderlaura.com/Lists/Posts/Post.aspx?ID=82
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • How to connect sql server using oracle Client

    Hi,
    I am working in oracle9i and windows os 32 bit.
    I need to connect SQL server 2000 from my oracle client..
    I heard about heterogeneous connectivity ...
    Please expalin me the steps what to add and how to connect the sql server...
    Regs....

    Are you trying to connect to SQL Server from your Oracle database (i.e. create a database link in Oracle to SQL Server)? Or are you trying to connect to SQL Server using your Oracle client software (i.e. SQL*Plus)?
    The former just requires Heterogeneous Services with Generic Connectivity. The latter is functionality that has been depricated and probably no longer works in your environment.
    Justin

  • Dump while acessing tables in sql 2005 using DB connect

    we have a sql 2000 as source system in place and now i created sql 2005 source system with DB connect.
    bw version 3.0.
    tables naming conventions are according to SAP.
    when i click the button to show tables in source system (sql server) , it is throwing a short dump while connecting to data base.
    I initially thought tahat something wrong with BW support pack , but my other sql connection is working perfectly fine.
    plz help.
    error in short dump
    Error analysis                                                                               
    <b>Only message types A, E, I, W, S and X are allowed.
    There is probably an error in the program          
    "RSDL_META_UPLOAD ".                               </b>
    <b>MESSAGE_TYPE_UNKNOWN" C                   
    RSDL_META_UPLOAD " or "RSDL_META_UPLOAD " 
    END-OF-SELECTION</b>"
    > points will be awarded for useful inputs..
    Message was edited by:
            aravind sam
    Message was edited by:
            aravind sam

    I am having the similar issue. I have DB connect to oracle schema, however, some of the tables I can view and access the data but others are throwing short dumps and following error:
    Event with errors RSDL_META_UPLOAD in DataSource
    I have applied support Pack 10 for BI. But this problem persist.
    Any IDEA.
    Thanks in Advance.
    Shaukat

  • How to store jpeg images in SQL server using NI database Connectivity Toolset. Can anyone please help me in this regard.

    Please tell how to store jpeg images in SQL Server using NI Database Connectivity Toolset.

    http://www.w3schools.com/sql/sql_datatypes.asp
    You setup a field as BLOB and store the binary of the picture there. Depending on the database it can be called differently as you can see in the link, in SQL server there's even a Image datatype.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • I have just used air display with macbook pro. i have disconnected now from apple tv. but my laptop screen is still very small like its connected to the tv. this means all the tabs and writing is very small, how do i full disconnect my laptop?

    i have just used air display with macbook pro. i have disconnected now from apple tv. but my laptop screen is still very small like its connected to the tv. this means all the tabs and writing is very small. like the display down the bottom where al the applications are, is n the middle of the page and not spread down the bottom. this is seriously annoying! all the writing is every small and the tabs are small and its hard to read.  the air display link has disappeared from my computer. but the laptop screen is still very small. i want to know how do i get rid of this and return my macbook screen to its normal size. thank you

    Hello chrispyw,
    If your content is still being displayed incorrectly, I would check the resolution setting for the built in display with this article:
    OS X Yosemite: Adjust your display’s resolution
    If it keeps happening whenever you use AirPlay then I would use this section of the following article to reset the display system:
    Apple computers: Troubleshooting issues with video on internal or external displays
    Reset the system
    You can reset the Mac's parameter RAM and SMC.Reset the resolution
    Start by resetting the Mac's parameter RAM. If the display does not come up, was previously set to an unsupported resolution, and still results in no video:
    Start up in Safe Mode.
    From the Apple () menu, choose System Preferences.
    Choose Displays from the View menu to open the preferences pane.
    Select any resolution and refresh rate that your display supports.
    Restart your computer.
    Thank you for using Apple Support Communities.
    Regards,
    Sterling

  • Query regarding connecting dashboards with SQL DATABASE using WSDT

    Hello Sir,
    I am trying to connect dashboards with Sql database via WSDT, but i have encountered the same problem as described in your SAP community blog (SAP Web Service Design Tool: From web service creation to Xcelsius consumption).
    when i tried connecting CR server with WSDT ,it still shows that total number of available licenses is 0.
    What can be done to solve this issue.
    for your detail reference, we are using CRS NUL version's 60 days Evaluation keys and same with Xcelsius Departmental edition.
    I would really appreciate, if you revert back to my mail as soon as possible

    Which version of Crystal Reports are you using? The regular ReportDocument SDK probably isn't robust enough to handle this, unless you create a connection using that connection string at design-time which you don't change at runtime. You might be able to add those properties using the in-proc RAS SDK, though. This is available with CRXI R2 as of SP2, and CR2008.

  • How to connect SQL server using JRun

    I am relatively dumb into Java. I am running JRun server in Unix box, and I need to connect to the SQL server (full marks for guesssing that SQL server is on the Win2K box).
    Now I want to connect to the SQL server from Jrun using JSPs.
    Question:
    1. Is JDBC:ODBC only way to connect to the SQL server, if yes -
    2. Do I have to create a DSN on the server for the JDBC:ODBC bridge to work
    3. Can I write my own database connection package,
    Appreciate if any body can help me with this problem, and if you have written a package to connect to the database, then would be nice if you would let me try the same.
    If you have any responses, please email me at [email protected]
    Thanks in Advance for the anticipated help.
    Viviar Prasad

    Hi Prasad,
    There is two ways(what I have done) to connect to sql server in jRun..
    1) using your jdbc - odbc connectivity using your type one jdbc driver..
    2) using type 4 driver.. (type 2 and 3 are not available right now for sql server)
    in 1 you have to create an dsn and use it directly in program bypassing jrun management console(I mean u don't have to configure for that)
    in 2 case you need to use jrun proprietery driver for the jdbc... there is a problem here..
    this driver is available in Jrun 3.0 enterprise edition only and still has got some problem so you need to apply service pack-2 to your Jrun installation and need to download the driver.. jdbc driver from following link
    ftp://ftp.allaire.com/kbftp/jrun/all/jrun_drivers.jar.zip
    this will suply a html doc along with the driver . which will explain you how to apply..
    you can download jdbc driver specilly for sql server from this link http://www.j-netdirect.com/jsqlconnect2_26.zip
    but it will expire in a month..
    any way once you have obtain any of the above driver, follow these step to configure jdbc in jrun.. you need to put the driver in the classpath..
    1 - open your management console
    2- select the webapplication for which you want to configure from left frame of mc(management console)
    3- select jdbc data source click the add button and follow the wizard..
    for more info ref to jrun quick start configuring jdbc settings that came with your JRun..
    or you can directly click the link there and type
    the name of the
    first
    datasource(you have supply any name you will be using that to access db in your java prog)
    second name of the the jdbc driver
    for Jrun it's
    allire.jrun.jdbc.JRunDriver
    for net direct
    com.jnetdirect.jsql.JSQLDriver
    third
    url for jrun driver
    jdbc:jrun:sqlserver://hostname:portno/databasename = dbname; USER = uname; Password = password
    where dbname is your database name
    uname is your sql server user name e.g sa
    password is your password for the corresponding user name
    where hostname is the name of the computer where your sqlserver is running it could be an ip e.g 10.0.0.32:1433
    1433 is the default port no for the sqlserver if you are using tcp protocol to connect to the sql server
    url for net direct
    jdbc:JSQLConnect//hostname:port/databasename=dbname; USER =uname; Password = password
    for any more information on this you can mail me in this id
    [email protected]
    All the best..
    regards
    Bishwa

  • Connection ... able to connect using sql developer, but not sqlplus or toad too

    Hi folks, having this issue, with only one of my so many databases, what might be the reason and how to fix/correct this, please assist.
    Able to connect using sql developer, but not sqlplus or toad too; sqlplus error: ORA-12154: TNS:could not resolve the connect identifier specified
    thanks in advance.

    SQLDEVELOPER works since it use JDBC Thin & does not use tnsnames.ora
    ORA-12154 ALWAYS only occurs on SQL Client & no SQL*Net packets ever leave client system
    ORA-12154 [B]NEVER[/B] involves the listener, the database itself or anything on the DB Server.
    ORA-12154 occurs when client requests a connection to some DB server system using some connection string.
    TNS-03505 is thrown by tnsping & is same error as ORA-12154 thrown by sqlplus or others.
    The lookup operation fails because the name provided can [B]NOT[/B] be resolved to any remote DB.
    The analogous operation would be when you wanted to call somebody, but could not find their name in any phonebook.
    The most frequent cause for the ORA-12154  error is when the connection alias can not be found in tnsnames.ora.
    The lookup operation of the alias can be impacted by the contents of the sqlnet.ora file; specifically DOMAIN entry.
    TROUBLESHOOTING GUIDE: ORA-12154 & TNS-12154 TNS:could not resolve service name [ID 114085.1]
    http://edstevensdba.wordpress.com/2011/02/26/ora-12154tns-03505/

Maybe you are looking for

  • Java.lang.ClassCastException: com.sap.tc.webdynpro.progmodel.context.Modifi

    Hi All, when i try to run a sample adobe webDynpro application i am getting this error - 1) One text filed on adobe form . 2) Mode used is generate PDF Please look into it and through some light to resolve this . <b>Root Cause</b> The initial excepti

  • Applephotostreams.exe entry point not found error

    In the last several weeks I've been receiving the following error message upon startup of my Windows 7 PC: applephotostreams.exe entry point not found I've tried searching for similar error messages on the web and in this forum without finding a solu

  • VoFR PVC for data and PVC for voice with FRTS

    Dear friends, It is my first experience configuring VoFR. My access rate is 128 Kbps and the CIR is 64 Kbps. I configured the router following some cisco examples using "vofr cisco" and FRTS into my "map-class" for voice. You can see my config in the

  • Mouse gestures in Sarafi 4?

    Hey there, the only reason i'm not switching from Firefox to Safari is that i still couldn't figure out how to use mouse gestures. I just love to be able to close a tab just by making a mouse gesture. I saw that there is the "Installed Plugings" menu

  • String to Date object

    how do i convert "Sat Sep 08 22:27:05 GMT+00:00 2001" into a Date object