<div dir="ltr"><div dir="ltr">Your mail ended up in gmail spam (when the programs are too smart they end up being stupid).<br>I'll enclose what I promised.</div><div dir="ltr"><br></div><div>Regards</div><div>Gianluigi<br></div></div><br><div class="gmail_quote"><div dir="ltr">Il giorno ven 28 set 2018 alle ore 15:14 Frank H Aldridge <<a href="mailto:franka@iway.na">franka@iway.na</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am an absolutely new user of Gambas, 76 years old and only using it to<br>
write simple self-use programs. I bought the e-book Beginners Guide to<br>
Gambas, Revised edition from Amazon and as a consequence it does not have<br>
the cd that would have been included with the hard copy.<br>
<br>
I am using Ubuntu 18.4 and Gambas 3.11.90 together with SQLite.<br>
<br>
Because I don't have the cd I decided to "create" the Database1 program<br>
described in the book under "The Database Example Program". I have created the main form as well as the FRequest form, both with their various<br>
controls.<br>
<br>
On FMain (I noticed that you cannot change the name of the Main form) I<br>
placed a Textbox at the bottom in a Frame called SQL request.<br>
<br>
During the instructions detailing how the program "works" there is the<br>
following quote:<br>
<br>
"we set the enabled properties for both program forms to TRUE and place some default text in the SQL request box at the bottom of the FMain form:<br>
<br>
frmDatabase.Enabled = TRUE<br>
frmRequest.Enabled = TRUE<br>
txtRequest.Text ="Show Tables"<br>
<br>
1. At this point my problem is that there are no forms called frmDatabase or frmRequest.<br>
<br>
2. My next problem is that the Textbox does not accept multi-lines.<br>
<br>
The code for the "RUN Button" (next to the SQL Request text box is:<br>
<br>
Public Sub btnRun_Click()<br>
<br>
Dim rData As Result<br>
<br>
Dim hForm As FRequest<br>
<br>
rData = $hConn.Exec(txtRequest.Text)<br>
hForm = New FRequest($hConn, rData)<br>
hForm.Show<br>
<br>
Catch<br>
Message.Error(Error.text)<br>
<br>
End<br>
<br>
3. When I click on the "Run" button a message comes up stating: Query<br>
failed: near "Show Tables"; syntax error. (I have only entered this oneline due to 2 above.<br>
<br>
If I blank the Textbox for the SQL query and insert a SQL query directly<br>
into the line:<br>
rData = $hConn.Exec("Select * from Test") instead of (txtRequest.Text)then I get the message:<br>
<br>
Cannot exec request<br>
Unknown symbol 'Width' in Class 'Font'<br>
OK<br>
<br>
Clicking OK brings the message:<br>
'Not enough arguments'<br>
<br>
I believe that the above two messages come from the following code under the FRequest form.<br>
<br>
Private Sub ReadData()<br>
<br>
<br>
Dim hTable As Table<br>
Dim hField As ResultField<br>
Dim iInd As Integer<br>
<br>
Inc Application.Busy<br>
<br>
tbvData.Rows.count = 0<br>
tbvData.Columns.Count = $rData.Fields.Count<br>
<br>
For Each hField In $rData.Fields<br>
With hField<br>
<br>
tbvData.Columns[iInd].Text = .Name<br>
<br>
tbvData.Columns[iInd].Width = WidthFromType(tbvData, .Type,.Length,.Name)<br>
<br>
End With<br>
<br>
Inc iInd<br>
<br>
Next<br>
<br>
tbvData.Rows.Count = $rData.Count<br>
<br>
Finally<br>
<br>
Dec Application.Busy<br>
<br>
Catch<br>
Message.Error("Cannot exec request" & "\n\n" & Error.Text)<br>
End<br>
<br>
Can anybody who may have this book and the CD perhaps throw some light on<br>
what may be causing the problems?<br>
<br>
-- <br>
Frank H Aldridge<br>
P.O. Box 3696<br>
c/o Kiaat & Bottle Tree Streets<br>
Ext. 15<br>
Swakopmund<br>
+264(0)811248922<br>
<br>
<br>
----[ Gambas mailing-list is hosted by <a href="https://www.hostsharing.net" rel="noreferrer" target="_blank">https://www.hostsharing.net</a> ]----<br>
</blockquote></div>