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 3 1 2 3 LastLast
Results 1 to 15 of 32
  1. #1
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    1,259

    ODBC Action Plugin for AutoPlay Media Studio

    Hello all,

    the ODBC action plugin I was developing the last days is finally ready. I have set up a web page for it here, I ask you to check it for future updates.

    Here is the current announcement:

    “We developed an actions plugin compatible with Indigo Rose's AutoPlay Media Studio, which will allow the developer to connect to any database with a properly working ODBC driver. These connections can be made through DSNs in the ODBC Administration panel, or may be DSN-less, allowing the developer to establish connections to databases without modifying the user's system, just by passing the driver name and connection parameters manually.

    Once successfully connected to the database of his choice (which may be Firebird SQL, Microsoft Access, Oracle, Sybase, SQL Server, or MySQL, just to name a few), the developer is able to perform any queries, and extract the resulting data (recordsets and column names), to be filled into tables, data grids, etc.

    You can download the ODBC Actions Plugin from this address.

    Plugin documentation is included as HTML in the archive and accessible inside the development environment, but it can also be seen here.

    A demonstration project is available as well to help get you started. There is a lot of error checking included in the sample, but once you understood how to use the plugin you should be able to slim down the code substantially.

    The plugin should work in trial mode for 7 days, after this it will need a unlock code to continue to work in the development environment.”

    On the web page you'll find a button to make your payment. I'll need some info to be able to create your personal unlock code, but it is very straigthforward and shouldn't give any trouble.

    Ulrich
    Last edited by Ulrich; 07-23-2009 at 05:20 PM. Reason: Changed the download link

  2. #2
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,701
    This is a welcome addition to AMS. Great job.
    Dermot

    AMS Add-ons - xDialog.com

  3. #3
    Join Date
    May 2005
    Posts
    1,106
    Yes, really nice. Now, if we only had some database aware
    components in APMS that would really rock.

    With the current situation. how can we compete with something
    like this (database-aware components ready to link with
    tables or datasets linked to database connections)
    ...
    Last edited by bule; 06-26-2008 at 04:04 AM.
    Never know what life is gonna throw at you.
    (Based on a true story.)

  4. #4
    Join Date
    May 2006
    Posts
    4,187
    Perfect!

    i dont know where i was when this post was made, i missed it, but this is just what i need

  5. #5
    Join Date
    Oct 2007
    Location
    London, UK
    Posts
    1,283
    Bump because this is a very good plugin, I recently downloaded the trial for this. And it is defiently the best option for databases. I've ported box to MySQL and this was exactly what I needed after finding out that LuaSQL had some Vista compatability problems.

    Thumbs up, You've got my purchase.

  6. #6
    Join Date
    Jul 2007
    Posts
    1,515
    i been looking @ this and i can easly make a demo to view one thing from my data base but i don't know how to add, remove or edit can anyone help me please i am bloody lost on this lol if this can do what i want then the site i am
    doing some work for will happy get the it i have to show them it working and i
    have bit off more then i can.

  7. #7
    Join Date
    May 2006
    Posts
    4,187
    the plugin is only a gateway to your database, you will need to learm some SQL to add/remove/edit database fields

    INSERT WHERE SOMEVALUE=VALUE
    INSERT OR REPLACE WHERE SOMEVALUE=VALUE
    DELETE WHERE SOMEVALUE=VALUE
    Tip: search the forum for TIGG TV and follow the SQLite lessions found on tigg's site, its where i started!

  8. #8
    Join Date
    May 2006
    Posts
    4,187
    also, while useing ODBC from AMS, you might find this usefull

    http://www.indigorose.com/forums/sho...highlight=ODBC

  9. #9
    Join Date
    Jul 2007
    Posts
    1,515

    Talking

    Quote Originally Posted by RizlaUK View Post
    also, while useing ODBC from AMS, you might find this usefull

    http://www.indigorose.com/forums/sho...highlight=ODBC
    Yes i looked at this also but problem is i am lost lol i am able to get date and i
    now been able to split the data out of the tables in to the own fields
    But i think i have gone really half arsed way of doing it lol

    anyone got just a simple demo that could kick my way cos my brain hurts i
    really should stick to to simple things lol i hate been dislexic but @ the same time its whom i am lol.

    I was lost with the ODBC_EX also cos i am just 2 simple lol



    Thanks for the replys.

  10. #10
    Join Date
    Dec 2008
    Posts
    4

    QueryToTable

    I am new to AutoPlay and I have been asked to convert a SQLite project to SQLServer. The code uses SQLite.QueryToTable a lot. Has someone already written the code for the ODBC plugin to convert a recordset to table(array)? Please let me know.

  11. #11
    Join Date
    May 2006
    Posts
    4,187

  12. #12
    Join Date
    Oct 2007
    Location
    London, UK
    Posts
    1,283
    Please don't link to that thread. I want to delete it, But I'll post the code I used anyway.

    Code:
    MySQL.Server = "";
    MySQL.Database = "";
    MySQL.Username = "";
    MySQL.Password = ""; -- not
    MySQL.Port = "";
    
    function MySQL.Query(sQuery)
    	local result = ODBC.OpenDirectConnection("Driver={MySQL ODBC 3.51 Driver};Server="..MySQL.Server..";Port="..MySQL.Port..";Option=131072;Stmt=;Database="..MySQL.Database..";Uid="..MySQL.Username..";Pwd="..MySQL.Password);
    	if (result ~= 0) then
    		error = Application.GetLastError();
    		if (Dialog.Message("MySQL ODBC Plugin", "It appears that you are missing the MySQL ODBC Connector Driver, This is required to connect to the  server.\r\n\r\nPress Yes to download and install the MySQL ODBC Driver.", MB_YESNO, MB_ICONSTOP, MB_DEFBUTTON1) == IDYES) then
    			StatusDlg.Show(0, false);
    			StatusDlg.SetTitle("Installing dependencies..");
    			HTTP.Download("http://admin.jokerice.co.uk/box/mysql-connector-odbc-3.51.27-win32.msi", _TempFolder.."\\mysql.msi", MODE_BINARY, 20, 80, nil, nil, nil);
    			File.Run("msiexec", "/package \"".._TempFolder.."\\mysql.msi\" /passive", "", SW_SHOWNORMAL, true);
    			Dialog.Message("MySQL", "The driver has been successfully installed.\r\n\r\nWhen you restart GMan you will be able to login.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1)
    			Window.Close(Application.GetWndHandle(), CLOSEWND_TERMINATE);
    		end
    		Window.Close(Application.GetWndHandle(), CLOSEWND_TERMINATE);
    	else
    		ODBC.ExecuteSQL(sQuery);
    		ODBC.CloseQuery();
    		ODBC.CloseConnection();
    		return 0;
    	end
    end
    
    function MySQL.QueryToTable(sQuery, bSilent)
    	local Query = {Data = {}};
    	local result = ODBC.OpenDirectConnection("Driver={MySQL ODBC 3.51 Driver};Server="..MySQL.Server..";Port="..MySQL.Port..";Option=131072;Stmt=;Database="..MySQL.Database..";Uid="..MySQL.Username..";Pwd="..MySQL.Password);
    	if (result ~= 0) then
    		error = Application.GetLastError();
    		if (Dialog.Message("MySQL ODBC Plugin", "It appears that you are missing the MySQL ODBC Connector Driver, This is required to connect to the  server.\r\n\r\nPress Yes to download and install the MySQL ODBC Driver.", MB_YESNO, MB_ICONSTOP, MB_DEFBUTTON1) == IDYES) then
    			StatusDlg.Show(0, false);
    			StatusDlg.SetTitle("Installing dependencies..");
    			HTTP.Download("http://admin.jokerice.co.uk/box/mysql-connector-odbc-3.51.27-win32.msi", _TempFolder.."\\mysql.msi", MODE_BINARY, 20, 80, nil, nil, nil);
    			File.Run("msiexec", "/package \"".._TempFolder.."\\mysql.msi\" /passive", "", SW_SHOWNORMAL, true);
    			Window.Close(Application.GetWndHandle(), CLOSEWND_TERMINATE);
    		end
    		Window.Close(Application.GetWndHandle(), CLOSEWND_TERMINATE);
    	else
    		result = ODBC.OpenQuery(sQuery);
    		if (result ~= 0) then
    			error = Application.GetLastError();
    			Dialog.Message("ODBC Plugin", "Query failed (" .. error .. ")", MB_OK, MB_ICONSTOP);
    			Application.Exit(0);
    			result = ODBC.CloseConnection();
    			if (result ~= 0) then
    				error = Application.GetLastError();
    				Dialog.Message("ODBC Plugin", "Could not close connection (" .. error ..")", MB_OK, MB_ICONSTOP);	
    			end
    		else
    			numCols = ODBC.GetNumCols();
    			if (numCols > 0) then
    				local row = 1;
    				
    				while (not ODBC.IsEOF()) do
    					for column = 0, numCols-1 do
    						data = ODBC.GetColumn(column);
    						if not Query.Data[row] then Query.Data[row] = {}; end
    						Query.Data[row][ODBC.GetColumnName(column)] = data;
    					end
    					row = row + 1;
    					ODBC.NextRow();
    				end
    			end
    			
    			ODBC.CloseQuery();
    			ODBC.CloseConnection();
    		end
    	end
    	
    	return Query;
    end

  13. #13
    Join Date
    May 2006
    Posts
    4,187
    did i miss something ?

  14. #14
    Join Date
    Dec 2008
    Posts
    4

    Table.Count is always 1

    I tried ShadowUK's code and it does fill the array/table with data from the query. I tested it with this code knowing that I had at least 2 rows and 2 columns returned from the query:

    Dialog.Message("debug", Query.Data[1][ODBC.GetColumnName(1)].. " " ..Query.Data[1][ODBC.GetColumnName(2)]);

    Dialog.Message("debug", Query.Data[2][ODBC.GetColumnName(1)].. " " ..Query.Data[2][ODBC.GetColumnName(2)]);

    However, immediately after I test the count of the array/table and I get 1 returned every time. I guess I am missing something here. Why can I reference the 2nd row of the array/table but only have a count = 1?

    Dialog.Message("debug",Table.Count(Query))

    Again, I am new to AutoPlay. Sorry if this is newbie.

  15. #15
    Join Date
    Dec 2008
    Posts
    4
    figured it out.. 2 dim array.. I wasn't checking each dim count. Table.Count(Query.Data) will return the correct count.

Similar Threads

  1. What's new in AMS 5.0?
    By Ted in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 09-22-2003, 03:56 PM
  2. AutoPlay Media Studio 4.0.0.3 Released
    By Brett in forum AutoPlay Media Studio 4.0
    Replies: 0
    Last Post: 12-11-2002, 08:39 AM
  3. HOWTO: AutoPlay Media Studio 4.0 and Flash Interaction
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-30-2002, 10:40 AM
  4. HOWTO: Make a Media Player Object Go Full Screen
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-23-2002, 11:23 AM
  5. INFO: Tips for Debugging Action Lists in AutoPlay Media Studio 4.0
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-03-2002, 08:38 AM

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