locked
SmallBasic MySQL database RRS feed

  • Question

  • Exist SMALLBASIC extension for MySQL database? I searched on the internet, but found nothing. Sorry for bad English.
    Friday, March 29, 2013 10:04 AM

Answers

  • Sorry there is none as far as I know at the moment.  Perhaps a good idea for an extension - it has been proposed before, but not done so far mainly due to the amount of setup a user would need to do to create a full database, which may be complex to orchestrate from SmallBasic.
    Friday, March 29, 2013 10:39 AM

All replies

  • Sorry there is none as far as I know at the moment.  Perhaps a good idea for an extension - it has been proposed before, but not done so far mainly due to the amount of setup a user would need to do to create a full database, which may be complex to orchestrate from SmallBasic.
    Friday, March 29, 2013 10:39 AM
  • Do not make someone SMALLBASIC extension? :)

    dev.mysql.com/downloads/dotnet.html

    dev.mysql.com/downloads/connector/net/5.2.html

    dev.mysql.com/downloads/connector/net/1.0.html

    zetcode.com/db/mysqlcsharptutorial/


    Friday, March 29, 2013 11:08 AM
  • I am already working on Sql database as of now i can only do SELECT, DELETE & UPDATE data in already existed database from Small Basic.


    Merry Xmas!

    Friday, March 29, 2013 1:17 PM
  • Can you please send the URL, or an extension?
    Friday, March 29, 2013 5:31 PM
  • Export it please!

    Best Regards Martin

    Saturday, March 30, 2013 6:17 AM
  • Came across a 'library to work with MySQL databases in Small Basic' here:

    Post your sample source code here and get featured on our blogs

    A lil down to the post from SteveKr (usage example for DataBase.  from SmallDataBase).

    The given DL link is cold, but found 2 identical DL links here: smalldatabase.zip (Archives)

     and here: smalldatabase.zip (HP)

    Contents:

    2008-10-27         2411           SmallDataBase.xml
    2008-05-07       290816         MySql.Data.dll            v 5.2.2.0, ADO.Net driver for MySQL
    2008-10-27         6656           SmallDataBase.dll      v 1.0.0.0, SmallDataBase, Runtime

    After successfull recomp. under NET3.5 for SB 1.0 it shows up in IntelliSense.

    Working?  No idea, don't know how to use the DemoCode under the first link. Anyone else ?? (knows how to use that ?? eg. DataBase.Connect("localhost", "root", "", "test")  )


    Monday, June 23, 2014 6:24 PM
    Answerer
  • Looks like it should work just fine - you will have to create and maintain the MySQL database outside SB since it can only query an existing DB.  Also you will have to retrieve table results one row and field at a time.

    EDIT

    On a closer look it looks like Query actually does a Command (so you can create and modify an MySQL database with it) and QueryAndFill does a Query with the results retrievable by GetResults for a row and field - also displaying the results table in WinForm using ShowGridWindow.

    • Edited by litdev Monday, June 23, 2014 7:08 PM
    Monday, June 23, 2014 6:53 PM
  • If it would be useable offline too (and thats the only usage i would be interested in, maybe incl. installation of the mysql cmdline tool) i have no idea, which values to enter for eg.

    DataBase.Connect("Name of the server", "database username", "", "The name of the database")

    Maybe:

    DataBase.Connect("Name of the server ??", "anyname", "", "Full path to existing db or database to create")

    Monday, June 23, 2014 7:51 PM
    Answerer
  • Afraid you have to install, configure and run MySQL server etc to access it.  Once installed, running etc you should be able to set users and password, create a db in some MySQL tools and finally access it in SB, using localhost (127.0.0.1).
    Monday, June 23, 2014 8:42 PM
  • Ok, thanks LitDev. I asked just out of interest. So for my offline usage only, i'll use LDDatabase which needs no additional files etc. and works great.

    Thanks

    Monday, June 23, 2014 9:04 PM
    Answerer
  • Its no so hard, starting http://dev.mysql.com/downloads/mysql/

    Getting MySQL service running and creating a user profile and a database I got it working - also added MySQL to my extension (all the same commands as for SQLite, except the connection requiring server, user, password etc).

    For learning about SQL from a SB perspective I would stick to SQLite, but if some-one has MySQL services running or networked, then it will be possible to access with my next release.

    Monday, June 23, 2014 9:36 PM
  • Yep, i'll check that out. Thx.

    btw: and about 'also added MySQL to my extension'.

    Saw 109's not online already, so just in time i wanted to tell you that:

    1. LDImage.Add and LDImage.Multiply  ignore transparency (remove alpha channel),

    2.) and also about LDImage.Add:  (when adding neg. values)

    eg. PxlColor = [128,128,128]  (like Image gray.bmp -> gray.png below, should have RGB = 128,128,128

    and then LDImage.Add(Img, -200,-200,-200) -> resulting PxlColor = [72,72,72]  !!

    128 - 200 = 72 ??    i would have expected  [0,0,0]  "Black" (or maybe 183 if in next/lower 0-255 range)
    just like in the example LDImage.Add(Img, 200,200,200) -> PxlColor = [255,255,255]

    Wanted to post samples about that tomorrow, too late today.


    Monday, June 23, 2014 9:55 PM
    Answerer
  • Thanks, I haven't created next update yet - will check out the above before I do - cheers.

    Fixed the alpha channel bits:

    For the -ve values, the reason is I take a modulus between 0 and 255.

    128-200 = -72 taking a mod is 72.

    I guess it make sense to do one of your suggestions - truncate at 0 or mod 256.  What do you think?

    EDIT - Now I remember why I did it that way:

    The modulus was to consider the difference between 2 bitmaps - I wanted 128-200 to give the same result as 200-128.  That is the difference between 2 images - the reason was I was playing with a webcam movement detection program.

    So there is a logic in there somewhere!

    • Edited by litdev Monday, June 23, 2014 10:42 PM
    Monday, June 23, 2014 10:21 PM
  • I would think 0,0,0 would be the default and most logical behaviour, just like

    LDImage.Add(Img, 200,200,200) -> PxlColor = [255,255,255]  ends at the other end of the range, while eg. an other -lower range here- would offer a greater variety (but could give ev. unexpected results and can also be done programatically). So i better leave it up to you, as i don't know how other apps manage this.

    Just lookin forward to 109.  :-)

    Thx and good nite.

    Monday, June 23, 2014 10:49 PM
    Answerer