How to make a database application - step by step example

  1. last year

    Please tell me where can I find a step by step example of how to make a database application.

  2. Lee P

    is not verified 12 Jun 2013 Hertfordshire, UK

    There are some basic but very good tutorials on the Rea lSoftware Youtube channel.

    RealSoftwareVideo

  3. Very poor database example on Youtube. No database detailed documentation.

  4. Lee P

    is not verified 12 Jun 2013 Hertfordshire, UK

    Please tell me where can I find a step by step example of how to make a database application

    You may need to be a little more specific. Which type of database REALSQLdatabase, SQL, MySQL, SQLite, AccessDB etc.

  5. MySQL

  6. Bob K

    12 Jun 2013 Alpha Testers, Beta Testers, Xojo Pro Kansas City

    I have a Real Studio series for subscribers at http://www.bkeeney.com/XojoTraining/xojotraining.cgi . It's an older Real Studio example but the basics are the same. I think it's about 10 hours long and we go from start to finish on a journal (diary) application. I also have a couple of addendum videos that convert it to use MySQL and how to use ActiveRecord.

  7. Lee P

    is not verified 12 Jun 2013 Hertfordshire, UK

    There is a MySQL video tut on the Real Software Channel that demonstrates creating, connecting to and executing queries.

    Also look at the Xojo Language references and tutorials.

    MySQL TuT

  8. John H

    12 Jun 2013 Beta Testers, Xojo Pro Planet earth
    Edited last year by John H

    @Aurel Vlase Please tell me where can I find a step by step example of how to make a database application.

    The old forum from Realsoftware ( http://forums.realsoftware.com ) you might find some examples as well.

    If it's first time you have to familiarize your self with SQL databases. I would suggest you start with the REALSQLdatabase/SQLite , then you can do all local and don't need to configure a MySQL server. And later you can move on to MySQL. Not much different between REALSQLdatabase and Mysql in Xojo/Realbasic coding.

  9. I know MySQL server. I don't know how to make database applications with Xojo and documentation is ...

  10. Where is Xojo detailed making database application? Nowhere.
    Really Xojo is good for database applications? Or may I look elsewhere?

  11. Matthew C

    12 Jun 2013 Beta Testers Roanoke, VA

    @Aurel Vlase Please tell me where can I find a step by step example of how to make a database application.

    See DB tutorial at xojodevspot.com

  12. Too much coding!
    Seems to be complicated.

  13. Tim H

    12 Jun 2013 Beta Testers Portland, OR USA

    That's the way it is. Xojo is not FileMaker.

  14. Peter F

    12 Jun 2013 Beta Testers, Xojo Pro New England

    The "Build My App For Me" button can be found in Preferences under the "Wishful Thinking" tab.

    Xojo is a tool not a panacea.

    Dig in. You may find it's not so bad.

  15. John H

    12 Jun 2013 Beta Testers, Xojo Pro Planet earth

    Aurel,

    I can give you some short examples here; how to create and read all content from a MySQL database.

    Hope this can help you a little bit. Below code is using a listbox with 3 columns

    Create Database

      Listbox1.DeleteAllRows
      Listbox1.AddRow "Create Database"
      
      Dim db As New MySQLCommunityServer
      Dim rs As RecordSet
      
      db.host = "HostName_Of_Database_Server"  // If your application is running on same Mysql Server Set db.host = "localhost"
      db.port = 3306
      db.DatabaseName = "rstest"
      db.UserName = "myname"
      db.Password = "mypassword"
      
      
      If Not db.Connect Then 
        Msgbox "Could not connect to database"
      Else
        db.SQLExecute("CREATE table Items ( id INT NOT NULL AUTO_INCREMENT, name TEXT,  number INTEGER, PRIMARY KEY(id) )")
        
        if db.Error Then
          MsgBox("DB Error: " + db.ErrorMessage)
        Else
          
          db.SQLExecute("INSERT INTO Items(name, number) VALUES ( 'Car', 20)")
          db.SQLExecute("INSERT INTO Items(name, number) VALUES ( 'House', 21)")
          db.SQLExecute("INSERT INTO Items(name, number) VALUES ( 'Notebook', 22)")
          db.SQLExecute("INSERT INTO Items(name, number) VALUES ( 'Realsoftware', 23)")
          db.SQLExecute("INSERT INTO Items(name, number) VALUES ( 'Realsoftware', 24)")
          db.SQLExecute("INSERT INTO Items(name, number) VALUES ( 'Realsoftware', 25)")
          db.SQLExecute( "COMMIT" )
        End If
        
        rs = db.SQLSelect("SELECT * FROM Items")
        
        If rs <> Nil Then
          While Not rs.EOF
            Listbox1.AddRow ""
            ListBox1.Cell(Listbox1.LastIndex,0) =  rs.Field("id").StringValue 
            ListBox1.Cell(Listbox1.LastIndex,1) =  rs.Field("name").StringValue
            ListBox1.Cell(Listbox1.LastIndex,2) =  rs.Field("number").StringValue
            rs.MoveNext
          Wend
          
        Else
          If db.Error Then MsgBox(db.ErrorMessage)
        End If
        db.close
        rs.Close
      End If
      

    Read all content from Database

      Dim db as New MySQLCommunityServer
      Dim rs As RecordSet
      
      db.host = "HostName_Of_Database_Server" // If your application is running on same Mysql Server Set db.host = "localhost"
      db.port = 3306
      db.DatabaseName = "rstest"
      db.UserName = "myname"
      db.Password = "mypassword"
      
      
      If Not db.Connect Then 
        Msgbox "Could not connect to database"
      Else
        rs = db.SQLSelect("SELECT * FROM Items")
        
        If rs <> Nil Then
          rs.MoveFirst
          Listbox1.AddRow "Read Recordset"
          While Not rs.EOF
            Listbox1.AddRow ""
            ListBox1.Cell(Listbox1.LastIndex,0) =  rs.Field("id").StringValue
            ListBox1.Cell(Listbox1.LastIndex,1) =  rs.Field("name").StringValue
            ListBox1.Cell(Listbox1.LastIndex,2) =  rs.Field("number").StringValue
            rs.MoveNext
          Wend
        Else
          If db.Error Then MsgBox(db.ErrorMessage)
        End If
        db.Close
        rs.Close
      End If
  16. Thanks for the encouragement, Peter.

  17. Paul L

    12 Jun 2013 Xojo Inc, Beta Testers, Xojo Pro United States (Maine)

    @Aurel Vlase Where is Xojo detailed making database application? Nowhere.
    Really Xojo is good for database applications? Or may I look elsewhere?

    Xojo is commonly used for creating database applications, but you'll have to put in a bit of effort on your part to learn how. It won't do everything for you.

    Connecting to MySQL works primarily the same as connecting to other database servers. Here is some information that ought to help get you started:

    • The User Guide has a section dedicated to MySQL: User Guide Book 3: Framework, Chapter 4 (Databases), Section 5 (MySQL)
    • Check out the MySQLCommunityServer class in the Language Reference: http://docs.xojo.com/index.php/MySQLCommunityServer
    • Xojo includes an example project with code to connect to a MySQL database, create a table and add data to it: Database/MySQL/MySQLExample

    We also have a YouTube video that walks you through the creation of the above example. It was done using Real Studio, but I bet it will still be helpful:

  18. Peter F

    12 Jun 2013 Beta Testers, Xojo Pro New England

    It actually was meant to be encouraging. If you know MySQL and therefore SQL you have spent some time learning the nuances of The SQL language. Xojo is no different. It takes some time and effort to wrap your head around.

    Try it. When you run into a road block ask a specific question. It isn't easy to provide a step by step example for a subject as large as "How to make a database application".

    I apologize if my attempt at humor was ill received.

  19. Thanks Peter.
    I want an example of a form, a grid, a report, if it is possible.

  20. Alex v

    12 Jun 2013 Beta Testers, Xojo Pro Europe, Switzerland

    Aurel, there are such examples - just have a look at Xojo's Example Projects Folder. People have been giving you plenty of hints now - Examples, the wiki (with very good instructions!) and even videos. What do you want more?

  21. Newer ›

or Sign Up to reply!