Indigo Rose Software
Indigo Rose Software
Log in to the Customer Portal Customer Login
Software Development Discussion Forums Forums
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 30
  1. #1
    Join Date
    Oct 2007
    Location
    London, UK
    Posts
    1,283

    FREE: MySQL Action Plugin

    MySQL Action Plugin



    This plugin is just to add functionality to AMS, I don't recommend using it in a program that will be publicly released.

    This plugin doesn't require LuaCOM as a dependency but it does use it. The plugin is around 300KB.

    Proof it works:



    Source is included in the ZIP.

    Find an example and the plugin attached to this post.

    Not related: I turned 14 on the 7th of September.

    IMPORTANT STUFF
    • The plugin requires the MySQL 3.51 ODBC Driver to be installed on the targets machine. (Download)
    • This is only recommended for private use. This plugin is not recommended for public applications.
    • COM exceptions are thrown on a MySQL syntax or server error. (Looks just like an AMS error dialog.)
    • Cake tastes nice.
    Attached Files
    Last edited by ShadowUK; 09-12-2009 at 02:48 PM. Reason: spelling errors

  2. #2
    Join Date
    Jul 2007
    Posts
    1,515
    Very nice you smart arss

  3. #3
    Join Date
    Oct 2007
    Location
    London, UK
    Posts
    1,283
    Hah, I wonder if people would prefer it to output like tbData[1]["field name"] instead of tbData["field name"][1]..

  4. #4
    Join Date
    Jul 2009
    Posts
    122
    I used a littel bit of your code to do this

    you can converse to your stack streamed system

    PHP Code:
    function DB.Query(statement)
    ---------------------------------------------------
    ---------
    exec


      
    if statement == "%BEGIN" then
        dblua_data
    .connection:BeginTrans()
        return
      elseif 
    statement == "%COMMIT" then
        dblua_data
    .connection:CommitTrans()
        return
      elseif 
    statement == "%ROLLBACK" then
        dblua_data
    .connection:RollbackTrans()
        return
      
    end

      
    if dblua_data.recordset == nil then
        dblua_data
    .recordset luacom.CreateObject("ADODB.RecordSet")
      elseif 
    dblua_data.recordset.State ~= 0 then
        dblua_data
    .recordset:Close()
      
    end

      dblua_data
    .recordset:Open(statementdblua_data.connection)
      
    -----------------------------------------------------
    ----------
    row

      local row 
    = {}
      
    local fields dblua_data.recordset.Fields
      local i 
    0

      
    while fields.Count do
      
        
    local field fields:Item(i)
        
    row[i] = field.Value
        row
    [field.Name] = field.Value

        i 
    1
      end

      dblua_data
    .recordset:MoveNext()
      --
    dblua_data.recordset:MoveFirst()
      
    local t=row
    -----------------------------------------------------
    ret={Fields,Field={},Data={{},{}},Count}

    ret.Fields=dblua_data.recordset.Fields.count
    min 
    1
    max dblua_data.recordset.Fields.count
    for count minmax do
        
    ret.Field[count]=dblua_data.recordset.Fields:Item(count-1).Name
    end
    dblua_data
    .recordset:MoveFirst()
    local c=0
    while not (dblua_data.recordset.EOF) do
    c=c+1
    ret
    .Data[c]={}
                for 
    0dblua_data.recordset.Fields.Count do
                    
    local Field dblua_data.recordset.Fields:Item(i);
                    
                    if 
    Field and Field.Value then
                        
    if not (ret.Data[c][Field.Name]) then
                            ret
    .Data[c][Field.Name] = {};
                            
    ret.Data[c][i+1]= {};
                        
    end
                        
                        ret
    .Data[c][Field.Name]=Field.Value
                        ret
    .Data[c][i+1]=Field.Value
                    end
                end
                
                dblua_data
    .recordset:MoveNext();
            
    end
    ret
    .Count=c
    return ret
    end 
    This returns the complete table including fields count and names, and test if recordset is working

  5. #5
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    2,414
    tData[i][field] would be nice shadow, but this is a briliant plugin, well done

    Oh, happy birthday (Can i have some cake too? ^^)
    Code:
    Debug (((($2A<<8)!$FF04A0B)!$FF04A0B)>>8)
    ;> 42.
    If I & AMS <3 : Debug "Who doesn't love AMS?!" : EndIf ; You may guess the output.
    Bas Groothedde
    Imagine Programming :: Join my Forum Group for plugin news and updates.

    My AMS Plugins:

  6. #6
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    1,259
    As an alternative, you can find a native MySQL plugin on my site. It does not use LuaCOM or ODBC drivers - the MySQL client library is statically linked to the plugin. The plugin works with AutoPlay Media Studio, Setup Factory, TrueUpdate and Visual Patch.



    Ulrich

  7. #7
    Join Date
    Oct 2007
    Location
    London, UK
    Posts
    1,283

    Thumbs up

    Shameless thread plug.

  8. #8
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    1,259
    Instead of opening a new thread and scatter the information in the forum, I think it makes more sense keeping related information together. After all, this is not a competition, and we are just offering two different solutions for the same problem.

    Ulrich

  9. #9
    Join Date
    Oct 2007
    Location
    London, UK
    Posts
    1,283
    Ah, fair enough.

    Mine has the advantage of being free but the disadvantage of using LuaCOM and ODBC.

    Yours has the advantage of having more functionality and no need for odbc but the disadvantage of having to pay.

  10. #10
    Join Date
    Jul 2009
    Posts
    122
    You're talking serious? On first, there aren't any disadvantage in ue odbc, most of windows programs uses to operate databases, but the plugin by ulrich is an probed and effective solution, if you use AMS to enjoy, I know that 30-days of use is a seriuous catch, but when you use in professional applications a tool effective and probed is relly needed, and the super-high-low cost of this (more unexpensive than a shirt) makes a good effect.

    I purchased his products and are perfect and helps me in my work.

  11. #11
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,701
    Quote Originally Posted by ShadowUK View Post
    Ah, fair enough.

    Mine has the advantage of being free but the disadvantage of using LuaCOM and ODBC.

    Yours has the advantage of having more functionality and no need for odbc but the disadvantage of having to pay.
    It's free http://www.mindquake.com.br/ams.php#plugins
    Dermot

    AMS Add-ons - xDialog.com

  12. #12
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,701
    Quote Originally Posted by pabloko View Post
    You're talking serious? On first, there aren't any disadvantage in ue odbc, most of windows programs uses to operate databases, but the plugin by ulrich is an probed and effective solution, if you use AMS to enjoy, I know that 30-days of use is a seriuous catch, but when you use in professional applications a tool effective and probed is relly needed, and the super-high-low cost of this (more unexpensive than a shirt) makes a good effect.

    I purchased his products and are perfect and helps me in my work.
    Cutting out 2 layers (ADO & ODBC) is very good. It will be faster. Plus if you are distributing your app, very few people will have the MySQL ODBC driver installed, so you could not rely on it.

    ODBC is great when you have no native way of working with the database.
    Dermot

    AMS Add-ons - xDialog.com

  13. #13
    Join Date
    Jul 2007
    Posts
    1,515
    Quote Originally Posted by Dermot View Post
    When i use this one to INSERT INTO it does it but crashers the app on windows 7 is there any reason why?
    it does do the action but crahers without and luck in using it again until reopened.

  14. #14
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    1,259
    Thanks for the notice, please update the plugin with the current installer.

    It is almost certain that I'll implement a few additional functions in the plugin, if the IR support desk remains as quiet as it was these days, so check for a possible update in the next couple of days.

    Ulrich

  15. #15
    Join Date
    Jul 2007
    Posts
    1,515
    Quote Originally Posted by Ulrich View Post
    Thanks for the notice, please update the plugin with the current installer.

    It is almost certain that I'll implement a few additional functions in the plugin, if the IR support desk remains as quiet as it was these days, so check for a possible update in the next couple of days.

    Ulrich
    Thanks i test this now.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Indigo Rose Software