Liberty BASIC Community Forum
« Eye On SQL »

Welcome Guest. Please Login or Register.
Nov 20th, 2017, 05:55am


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1 2 3 4  Notify Send Topic Print
 veryhotthread  Author  Topic: Eye On SQL  (Read 1750 times)
meerkat
Junior Member
ImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 67
xx Re: Eye On SQL
« Reply #45 on: Nov 11th, 2017, 07:55am »

I added Speech, movies, music, and photos to ionSQL in RunBasic.
As a complete novice to LB, I couldn't figure out how to do this.

In RB if you have a field beginning with "medi_" it will play or show the media pointed to in the field.
If the field begins with "spek_" it will speak whatever is typed in the field.

I'd like to do the same for the LB version if possible.

How do I do this??

Thanks for the help...
Dan
User IP Logged

Rod
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Graphics = goosebumps!


PM

Gender: Male
Posts: 5562
xx Re: Eye On SQL
« Reply #46 on: Nov 11th, 2017, 11:35am »

I think you should start with the ATL tutorial that Alyce provided.

This would give you a browser control that may provide some of the functionality you speak of. It depends on how much ionSQL is doing itself or whether it is simply directing the browser to do stuff.

New territory for us, so you will need to experiment.

http://lbpe.wikispaces.com/ATL+Tutorial

Let us know how you get on.
User IP Logged

meerkat
Junior Member
ImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 67
xx Re: Eye On SQL
« Reply #47 on: Nov 12th, 2017, 05:01am »

Thanks Rod,

I took a look at your suggestion a couple weeks ago about using the HTML interface.
It would solve a lot like grids, and all the HTML5 functions such as video, photos, voice, calendar popups, color popups and a lot more.

I like it, but still do not know how to get stuff back into LB from the interface.
I tried a simple login screen.
How do I get the username and password into LB
Here is the HTML I tried:
Code:
html$ =         "MSHTML:<html><head></head><body>"
html$ = html$ + "<FORM METHOD='POST'>"
html$ = html$ + "<TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0 BGCOLOR=wheat>"
html$ = html$ + "<TR><TD COLSPAN=2 ALIGN=CENTER><B>Please Log In</TD></TR>"
html$ = html$ + "<TR><TD ALIGN='RIGHT'>User Name</TD>"
html$ = html$ + "<TD><INPUT TYPE='TEXT' NAME='user' SIZE=25 VALUE='guest'></TD></TR>"
html$ = html$ + "<TR><TD ALIGN='RIGHT'>Password</TD>"
html$ = html$ + "<TD><INPUT TYPE='TEXT' NAME='pass' SIZE=25 VALUE='guest'></TD></TR>"
html$ = html$ + "<TR><TD COLSPAN=2 align=center>"
html$ = html$ + "<INPUT TYPE='SUBMIT' NAME='login' VALUE='Login'>"
html$ = html$ + "<INPUT TYPE='SUBMIT' NAME='exit' VALUE='Exot'>"
html$ = html$ + "</TD></TR></TABLE>"
html$ = html$ + "</form>" 


Thanks for the help
Dan
User IP Logged

Rod
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Graphics = goosebumps!


PM

Gender: Male
Posts: 5562
xx Re: Eye On SQL
« Reply #48 on: Nov 12th, 2017, 05:50am »

Perhaps someone better versed than me will offer advice. I have not played much with html/web code. Would your html code not store the input in the database or on the server? Would you not use httpget$() function to retrieve that info?

There are a few folks that will know the answer, lets hope they contribute.
« Last Edit: Nov 12th, 2017, 05:51am by Rod » User IP Logged

Colin McMurchie
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 226
xx Re: Eye On SQL
« Reply #49 on: Nov 12th, 2017, 09:31am »

Hi,

I am very rusty on this sort of stuff, and I could be wrong, but I think that you may need an 'action' attribute in your form field, for example something like

<form action="/action_page.php" method="get">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="submit" value="Submit">
</form>

This code is taken from the web site below.

https://www.w3schools.com/tags/att_form_action.asp

Also I am not sure about the first line. I do not recognise the MSHTML: bit in this context.

As Rod asks, are you sending this form (once completed) to a server (even on the same computer) and if so how are you getting your information back? Remember that this form is part of the client side interface. Where is the server side code?

Colin
User IP Logged

meerkat
Junior Member
ImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 67
xx Re: Eye On SQL
« Reply #50 on: Nov 12th, 2017, 5:22pm »

Thanks Colin.

You are soo right about <form action=.
I should know better, but I'm new to LB.

I don't know what MSHTML: is either. But without it the DLL does not work.

Ok I set <form action='http:localhost/c:libertyBasic/a.bas'
It finds it, but it don't know what to do with it.. I think I'll have to compile it.

My question is how do I get the passed information from the URL?

Thanks again for the help..
Dan


« Last Edit: Nov 13th, 2017, 03:32am by Rod » User IP Logged

Brandon Parker
Moderator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 1118
xx Re: Eye On SQL
« Reply #51 on: Nov 12th, 2017, 7:22pm »

Have you attempted to compile the Liberty BASIC .bas file and then execute the renamed runtime engine against your .tkn file? The webpage doesn't know what to do with the .bas file, but the runtime engine should if the webpage can start it up properly

{:0)

Brandon Parker
User IP Logged

Windows 7 Home Premium 64-bit Intel(R) Quad Core(TM) i5 CPU M 430 @ 2.27GHz 4GB DDR3 RAM
Colin McMurchie
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 226
xx Re: Eye On SQL
« Reply #52 on: Nov 13th, 2017, 04:25am »

Hi Meercat,

There are more questions than answers here I am afraid. The short answer to "how do I get the passed information from the URL?" is that the result is contained in the web page sent back from your program a.bas. But this assumes several things.

1) That a.bas sends a string of well-formed html to STDOUT - which LB does not do by default. Does a.bas do that? As Brandon says, it would have to be compiled and running to work. Can you show the code?

2) That you have an HTML server already running on the local machine, that is correctly linked to a.bas. Do you?

3) That you send your HTML form to the server through a valid browser or browser window, or alternatively use the MESOCK route mentioned earlier in the thread. Are you using such a browser? In other words, what are you trying to do with the html$ you assembled in an earlier post? Again, some more code would be helpful.

4) Finally, saving changes to your database is problematic via web technologies on local machines, for security reasons.

I am sorry of all this sounds complex, but it is. Working with databases is never simple. Leveraging the technologies built into moderm browsers is very appealing but it comes at a price. You could also investigate RUNBASIC personal edition for the server side. It is more suited than LB for a web based approach.

Are you sure you cannot get the results you want by using conventional LB widgets?

Colin
User IP Logged

Rod
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Graphics = goosebumps!


PM

Gender: Male
Posts: 5562
xx Re: Eye On SQL
« Reply #53 on: Nov 13th, 2017, 07:39am »

Can I just restate the problem. I am getting a little confused. So this is where I think we are. If I have the wrong end of the stick correct me.

We are working with SQLite as the actual database engine. SQLite is designed to work on the local disc or network. It will allow multiple access requests so we are talking a network solution not a web server solution.

ionSQL is a Liberty BASIC wrapper that allows creation and maintenance of a local database.

The reason we are using a browser is that it has been hard to format and display output using standard Liberty controls. The browser seems to offer a way to display text pictures and sounds as SQL might on a web page. So how to interact with an API created ATL Browser?
User IP Logged

meerkat
Junior Member
ImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 67
xx Re: Eye On SQL
« Reply #54 on: Nov 13th, 2017, 10:01am »

Thanks Rod.
You state the problem correctly.
The ionSQL has everything working ok. But the interface from LB is very week and cryptic. Even a simple grid is complex. Using html and <table> is simple. It adjust all the columns to size. It left and right adjusts. It allows a button by row that you can assign values. So basically if you loop through a table you only need one html statement to show all the rows, with a button per row to do something. And it knows what record the button wants.

It also validates numeric, decimal, dates. It has popup for dates, colors and whatever. HTML5 will play movies, songs, and display images. Everything is adjusted to size automatically. For example a album with 10 images across and 10 down will adjust the image size to fit in each cell and fit the window. You could click the cell(image) to do something like resize the image.

Anyway, I can live with what I have. I just don't like it much.
If LB had a two way interface to HTML things would look great, and take a lot less code.

I don't need it to be treated as a client/server. So local is fine.

Thanks for the help..
Dan
User IP Logged

Colin McMurchie
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 226
xx Re: Eye On SQL
« Reply #55 on: Nov 13th, 2017, 10:57am »

Hi Dan, Hi Rod,

If you are confused then so am I. Am I right in assuming we are no longer talking about the program here
http://kneware.com/libertybasic/ionSQL/ionSQL.bas - the link at th top if the thread, but the program here?
http://kneware.com/libertybasic/RunBasic/ionSQL.bas

If so, are we still talking about Liberty Basic or RunBasic?

If we are talking about runbasic and libertybasic together, how , how does it all work?

Colin
User IP Logged

meerkat
Junior Member
ImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 67
xx Re: Eye On SQL
« Reply #56 on: Nov 13th, 2017, 11:14am »

Colin..

I'm talking about the liberty Basic version. Actually it really doesn't have anything to do with the ionSQL program but with user interface in general. I only used ionSQL as a reference of how I was doing the user interface. And because I already had it working, it would be a way for me to try a better interface.
Maybe it should be a new thread.

Maybe it's me. I had a lot of problems with the grid and forms. As you can see from the LB ionSQL the grid (or list) and forms are terrible. I know there is a dll for displaying stuff, but not too powerful and not a lot of features. So I was looking for a way to do HTML to get a better interface. I'm beginning to believe it's not possible or as complex as the DLL itself.

I was just reaching out to see if it was possible.

Thanks for the help
Dan.

EDIT..
Something like RFO BASIC interface would be great..
http://rfo-basic.com/manual/#_Toc477208950
« Last Edit: Nov 14th, 2017, 03:05am by Rod » User IP Logged

Rod
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Graphics = goosebumps!


PM

Gender: Male
Posts: 5562
xx Re: Eye On SQL
« Reply #57 on: Nov 14th, 2017, 03:15am »

The idea is that Liberty BASIC accesses SQLite. Carl had something planned for LB5 that allowed native access to a SQLite local database.

That part has been solved by a couple of folks. However without the "Grid" widget planned for LB5 it is quite hard to show structured table data. meerkat wants to take it a step further and allow video, picture, sound and speech data to be presented in a structured way.

As he knows this can be done in Run BASIC using a browser he is trying to find a way to use a browser locally.

As I see it LB sends the browser html code that links to a database and displays info. If the info changes like a password then the html code updates the database. Then LB polls the database to see if there is input. If so it sends the next set of html to the browser. Sounds feasible but I don't have the skills.
« Last Edit: Nov 14th, 2017, 03:50am by Rod » User IP Logged

Pages: 1 2 3 4  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls