I am looking for help as to how to communicate with an online database through a desktop app. First question… This is possible, right?
I guess I really need to start with how do I set up an online database that Xojo can work with? Are there any you suggest looking into? Preferrably free/inexpensive
Next, let’s just take a simple example… How do I click on a button in the desktop app to, say, search this online database. I can probably figure out the rest of my needs from there
Any and all help much appreciated!
There are several example in the Xojo distribution. I used the mySQLexample as a starting point. I have a Mac Mini with OX Server on it. It has PostgreSQL installed, which OX Server uses as it database. Tried using, ending up installing mySQL (that another -long- story).
If you have a Mac it already has Apache and mySQL is free, so is PostgreSQL.
Xojo can connect to a variety of database servers, including: PostgreSQL, MySQL, Oracle and Microsoft SQL Server. It can also use ODBC to connect to just about anything else.
You Xojo installation includes several example projects to get you started:
Thanks guys. I downloaded MySQL Community Server. Hopefully isn’t too complicated with setting up. The database example looks pretty straightforward. I’ll give it a go and post if I run into any complications
Ok, so I do need a little help. I have my website hosted through godaddy which provides me with some MySQL databases. I talked to the guy at GD who walked me through setting the MySQL up but then that was as far as he could go. I plugged in the Host, UserName, Password, and DatabaseName into a test app. When running and trying to connect, it says “DB Error: Can’t connect to MySQL Server on ‘testdb6665.db.10400358.hostedresource.com’ (10013)”
I have the Host set to - testdb6665.db.10400358.hostedresource.com
The UserName and DatabaseName are both set to the same - testdb6665
And the password is the pw I set for this db.
What am I missing? Can I do this with godaddy?
Yes you can do this with GoDaddy. I have an app that uses GoDaddy MySQL database
You MUST click on “Additional Options” and then check “AllowDirect Access” when creating the database. Unfortunately once a database has been created, direct access cannot be assigned to it. You must delete and re-create the database
Thanks Art. I just recreated the DB and checked allow access but still getting the message that it cannot connect. Are my Host, DatabaseName, and UserName correct above? Or is the Host different and DBName and UN different from each other? When recreating, I chose the MySQL 5.0 (recommended), not 5.5, and then in the additional options, I did not change the Read-only name or the password beneath that either.
The host name looks reasonable. User name and database name should be the same, don’t know your password (of course). If you would like me to help, you can communicate with me via firstname.lastname@example.org I’ll try to connect with a password you send me
Well, make sure you read http://www.mysql.com/products/ and understand the concept of a GPL-License. I wonder if there is another software whose license terms are violated as often as MySQL’s.
+1 for the “free”. As far as I understand the licensing - and everybody has a different understanding - you can use MySQL for your own use and your website for free. Everything else is starting from 10.000 $ per year.
By the way, another question you should be asking is “Should you be connecting to an internet database?”
You really should be adding another layer between your app and your database, like an RPC system of some sort which you can secure and change on its own. Allowing apps direct access to the database means that ANYONE can directly access it, especially if their intentions are purely nefarious. If the database has any vulnerabilities, they’ll find it.