Connecting to other databases ( contd )

new BookmarkLockedFalling
telbourn7
New Member
*

telbourn7 Avatar

Posts: 20Male

carlgundel
Administrator
*****
Creator of Run BASIC

carlgundel Avatar

Posts: 975

gcav
New Member
*

gcav Avatar

Posts: 11Male

Carl Gundel - admin
Administrator
*****

Carl Gundel - admin Avatar

Posts: 550

bovnet
New Member
*

bovnet Avatar

Posts: 27

mcgeorge
New Member
*

mcgeorge Avatar

Posts: 1

jerry
Junior Member
**

jerry Avatar

Posts: 86Male

An old guy that cant wait to retire!
jerry
Junior Member
**

jerry Avatar

Posts: 86Male

Post by jerry on Mar 21, 2019 17:16:33 GMT -5

Yeah... it's 6 years since the last post to this topic. But...

What I do to access mysql is this. I wrote three programs in freebasic. One inserts, one updates, one does selects on mysql. I then write my runbasic front end that calls one of the three "freebasic servlets" via rc$ = shell$(freebasic.servelet). in the call I pass the name of the db, the table and whatever columns I want to include" if the call is successful, I get back the results in rc$. If the call fails then rc$ = "".

The run basic looks like:
a$ = shell$(extrasFilePath$+"password "+name$+" "+pass$)

In this example the freebasic servelet named password, connects to mysql, does a select on the password db, password table for a match for the name$ and pass$. Success returns the environment setup for the user in rc,ドル a failed match returns rc$="" and an error returns rc$="ERROR". It's works! It's quite fast and Ive done a lot of runbasic front ends for a number of projects.

Anyone interested, I'll happily share my freebasic source code. Contact me: jmcbride@mail-on.us

An old guy that cant wait to retire!
jerry
Junior Member
**

jerry Avatar

Posts: 86Male

Post by jerry on Sept 2, 2020 17:46:52 GMT -5

Ive since rewritten the three freebasic servlets ablve into just one. Before I describe the freebasic part, I'll discuss the MYSQL part.

I only support specific runbasic work apps that hammer on a company mysql cluster. My apps do simple queries including highly complex writes, updates, etc.. What Ive been able to do is create a database with multiple tables. Im able to cap the table size to a max of 52 columns. The naming of each column in each table uses the same layout. Column 1 is named 0A, next is 0B, up to 0Z. When I hit the 26th column the name changes to 1A, then 1B all the way up to 1Z. This allows the 52 column width needed for some of the user base needs.

Now, my new single servlet accepts, as input; number of columns to expect, database name, tablename, A single letter command (Read,Write,Update) and then a string of comma separated data.

With the ability to specify a table width in the call along with table name eliminates a lot of unnecessary code and makes maintenance of the applet source very easy.

Using the applet, I can access tables as small as one or two columns, to as large as 52 columns, which is our maximum use case.

An old guy that cant wait to retire!