Hi,
These questions are coming from a zero-experience perspective, having just loaded Livecode and never programmed in my life... I briefly worked on a Filemaker 7 database years ago.
Could some folks help me understand how Livecode works with a database on a local network. What I would like to do is create a livecode application that I can install on every PC on a windows workgroup (approx. 5 workstations), and have them all access the same database records.
For this do I have to create a server-version of the application, which kind of talks to the database, and then create a client-version for all the other workstations? Or do I just install a database on any one of the workstations and then 'point' all of the installed standalone Livecode applications to that single database... and would having an actual Windows server as opposed to a Windows workgroup offer any advantages related to Livecode development? I'm not sure how data integrity is controlled and how people are not allowed to write things concurrently. Perhaps these kinds of features are native to most database engines?
Also, when you deploy the final installable application, would the database have to be installed totally separately or does the installer for your final Livecode app also have the ability to coordinate the installation of a 3rd party database... that would be pretty nice. If this is the case would I make a server-version of the application which installs the client-app and ALSO installs the database, and a client-version of the application that ONLY installs the application, which would be used on any incoming new workstations. (Same application, essentially, just a different installer).
Still a lot of learning curve ahead of me.
But thanks in advance for any help getting on board!
Connecting Livecode app to a database on a local network...
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 4
- Joined: Mon Apr 26, 2010 7:55 am
Re: Connecting Livecode app to a database on a local network
You have a lot of choices possible in Livecode. Most of them you mentioned in your post. Everything depends fom your project an how you orfanize it. It's no differene if it's LAN, WAN or internet connection.
You can build small "server" as standalone LC using free SQLite, but in this case you must buil in it your own routines for multiuser accounts (SQLite is single user db).
Next choice is setup any multiuse db and connect ti it by LC client. The simplest is Valentina Server Office /5 which is free for up to 5 users connecting in the same time (can be more, but every above 5-th client will be buffered until any of 5 connections will free). You can install VServer on almost any desktop system (MAC, PC, Linux).
You can use MySql or Postgre which are also free and without client limitation, but are more complicated to setup.
Hope it helped little bit.
Marek
You can build small "server" as standalone LC using free SQLite, but in this case you must buil in it your own routines for multiuser accounts (SQLite is single user db).
Next choice is setup any multiuse db and connect ti it by LC client. The simplest is Valentina Server Office /5 which is free for up to 5 users connecting in the same time (can be more, but every above 5-th client will be buffered until any of 5 connections will free). You can install VServer on almost any desktop system (MAC, PC, Linux).
You can use MySql or Postgre which are also free and without client limitation, but are more complicated to setup.
Hope it helped little bit.
Marek
Re: Connecting Livecode app to a database on a local network
The best recipe is to : experiment.
Grab a copy of MySQL Server.
It's really easy to install (on Windows).
Create an account, a database, a table and a few fields. And then run a few LiveCode scripts. You can do everything on the same machine (your local PC).
You'll find lot of examples, here or on the web.
Basically, here are the steps :
CONNEXION [127.0.0.1 means your local PC]
ERROR ANALYSIS
SQL REQUEST
ERROR ANALYSIS
CLOSE CONNEXION
DATA PROCESSING
Grab a copy of MySQL Server.
It's really easy to install (on Windows).
Create an account, a database, a table and a few fields. And then run a few LiveCode scripts. You can do everything on the same machine (your local PC).
You'll find lot of examples, here or on the web.
Basically, here are the steps :
CONNEXION [127.0.0.1 means your local PC]
Code: Select all
put revOpenDatabase("MySQL","127.0.0.1","my_first_database,"myLogin","myPassword") into dbID
Code: Select all
if dbID is not a number then
answer warning "Impossible to connect. Error : "&dbID
exit to top
end if
Code: Select all
put "SELECT * FROM my_first_table" into dbSQL
put revDataFromQuery(,,dbID,dbSQL) into requestResult
Code: Select all
if the Result begins with "revdberr" then
answer warning "There is an error "&the Result
revCloseDatabase dbID
exit to top
end if
Code: Select all
revCloseDatabase dbID
Code: Select all
answer info "Here is the result of the request "&requestResult