From owlbrudder at gmail.com Mon Jan 1 00:14:01 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Mon, 01 Jan 2018 09:14:01 +1000
Subject: [Gambas-user] What is wrong with my query syntax?
In-Reply-To: <20171231195550.GA21012@highrise.localdomain>
References: <1514519004.3262.102.camel@gmail.com>
<11352897-4c74-cd85-9f77-3ddd45ea4412@gmail.com>
<20171231195550.GA21012@highrise.localdomain>
Message-ID: <1514762041.12546.143.camel@gmail.com>
On Sun, 2017-12-31 at 20:55 +0100, Tobias Boege wrote:
> On Fri, 29 Dec 2017, ML wrote:
> > Just a very stupid observation: The query is completed by the
> > contents
> > of a textbox control (called TBXName) on the form where it's
> > supposed to
> > be placed.
> > If the syntax error comes from GAMBAS, this textbox may not exist
> > (didn't try actually, but a possibility nonetheless).
> >
> > On the other hand, if the error comes from the DB Engine
> > (PostgreSQL in
> > this case), then the query may be malformed; maybe a single quote
> > in the
> > textbox data is screwing the query up.
> > For example, suppose the textbox has the name "O'Malley". The query
> > string would become the following:
> >
> > ?SELECT * FROM Friends WHERE Name = 'O'Malley'?
> >
> > As you can see, the WHERE clause becomes "WHERE Name = 'O'" and the
> > "Malley'" excess string post-clause will trigger the syntax error
> > at the
> > DB Engine level.
> > You MUST escape all apostrophes at the very basic level or, better,
> > use
> > StoredProcedures with Parameters. Google up "SQL Injection" for
> > (lotsa)
> > more info.
> > Try with "' OR 1 --" in the textbox data to see some unwanted
> > effects
> > abused by database attackers...
> >
>
> Doug, you should listen to this advice about SQL injection. Code
> which
> puts unchecked user input into an SQL query string is easily
> exploited
> and gives the perfect security hole. A user can make the program
> crash,
> bypass filters in the rest of your query hence leak data, delete all
> the tables or add unwanted data -- everything that SQL can do,
> provided
> the executing user has the required privileges.
>
> Gambas can quote SQL queries for you:
>
> hConn.Exec("SELECT * FROM Friends WHERE Name = &1", "O'Malley")
>
> Better yet, use hConn.Find() if you want to do SELECT queries, like
> so:
>
> hConn.Find("Friends", "Name = &1", "O'Malley")
>
> If you need complex queries and have Gambas >= 3.8, you should use
> the
> SQLRequest class:
>
> Dim hSql As New SqlRequest(hConn)
> Dim sQuery As String
>
> sQuery = hSql.Select().From("Friends").Where("Name = &1",
> "O'Malley").And().Where("Age >= &1", 32).OrderBy("Age DESC").Get()
> hConn.Exec(sQuery)
>
> SQLRequest knows how to build a proper SQL sentence for the
> underlying
> database driver. Note how your Gambas code, if it uses Find() or
> SQLRequest,
> is free of SQL strings of a specific dialect. You can use the same
> Gambas
> code with MySQL, PostgreSQL, SQLite3, etc. (provided that the drivers
> work
> correctly). This is of course desirable: if you want to run unit
> tests,
> SQLite3 might be a good choice, but you might want to use Postgres
> for
> production and someone else might prefer MySQL.
>
> Regards,
> Tobi
>
> PS: when did this become a top-posting mailing list?
>
Hi Tobi.
Happy 1st of January everyone!
Tobi, as far as top/bottom posting is concerned, I admit I have just
been using my mail system (Evolution) default: wherever it puts the
cursor is where I start typing. If the convention is for bottom
posting, I will try to remember this. Apologies for any inconvenience.
As for your advice, it is all excellent. I had been using the
SQLRequest class and only dropped it to eliminate one possible source
of error. The SQL injection problem is in the forefront of my mind, but
right now I just want to get the bare bones working as simply as
possible.
I will do three things, in order:
1 Create a completely fresh project and type everything in by hand to
ensure there are no cut 'n paste artifacts causing problems.
2 If that does not work, I will create a similar MySql project and see
if it works on my machine.
3 If that works, I will bundle up my PostgreSQL project from step 1 and
a dump of the table I have been using - it has one row and 35 columns
(I know - don't ask - I inherited this mess).
Many thanks to you and everyone who has responded.
Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From mckaygerhard at gmail.com Mon Jan 1 00:48:31 2018
From: mckaygerhard at gmail.com (PICCORO McKAY Lenz)
Date: Sun, 31 Dec 2017 19:48:31 -0400
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To: <1514760996.12546.131.camel@gmail.com>
References: <1514684664.12546.82.camel@gmail.com>
<1514685624.12546.84.camel@gmail.com>
<1514701561.12546.114.camel@gmail.com>
<8c776eb0-44f9-bf27-ddbf-a671ea9774d2@gmail.com>
<1514760996.12546.131.camel@gmail.com>
Message-ID:
yeah Tobias, it's due postgres of coourse its for scalar grade and more
fine tune things.. of course with mysql and sqlite will not fail..
with postgres and odbc fail as the other already now confirmed, i reported
some time ago similar problems.. but due i was busy does not paid
attention..
i still must test and made some other fine tune agains the odbc updates in
gambas, i have many expoerience with but gambas must be still compile-able
in my ery olders linuxes
also i take a look to the stalled web-cam and vide4linux gambas module and
seems one of my manpowers at the job can made something.. but for now
there's many work in load..
Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com
2017-12-31 18:56 GMT-04:00 Doug Hutcheson :
> Good idea Lee - I will fire up MySql on my machine and try a similar
> approach.
>
> Using PostgreSQL, the For loop using a loop index works perfectly, showing
> the field names and the data, but the For Each loop fails on the 'For Each
> ... ' line.
>
> I will get back to the list about MySql.
>
> Doug
>
> On Sun, 2017-12-31 at 12:49 -0500, T Lee Davidson wrote:
>
> Yes, MyResult!txtMasterDatabase should work. (Did you copy/paste that name, or type it in directly?) The For Each loop should
> work as well.
>
> I tried a simple command-line application on a MySQL data table with just one row. All the application does is, first connect to
> the database, and then 'MyResult = hConn.Exec("select * from users")'
>
> A For Each loop prints the field names just fine. And, 'Print MyResult!id' displays the correct value.
>
> Perhaps there is a bug in the Gambas PostgreSQL driver. Can you test on a MySQL table to see if that works for you?
>
>
>
>
>
> --------------------------------------------------
>
> This is the Gambas Mailing List
> https://lists.gambas-basic.org/listinfo/user
>
> Hosted by https://www.hostsharing.net
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From owlbrudder at gmail.com Mon Jan 1 07:19:34 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Mon, 01 Jan 2018 16:19:34 +1000
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To: <2263ed80-159d-a85b-ac73-fd5b5cae90af@gmail.com>
References: <1514684664.12546.82.camel@gmail.com>
<1514685624.12546.84.camel@gmail.com>
<1514701561.12546.114.camel@gmail.com>
<8c776eb0-44f9-bf27-ddbf-a671ea9774d2@gmail.com>
<20171231201643.GB21012@highrise.localdomain>
<2263ed80-159d-a85b-ac73-fd5b5cae90af@gmail.com>
Message-ID: <1514787574.3338.6.camel@gmail.com>
On Sun, 2017-12-31 at 16:23 -0500, T Lee Davidson wrote:
> On 12/31/2017 03:16 PM, Tobias Boege wrote:
> > On Sun, 31 Dec 2017, T Lee Davidson wrote:
> > > Yes, MyResult!txtMasterDatabase should work. (Did you copy/paste
> > > that name, or type it in directly?) The For Each loop should
> > > work as well.
> > >
> > > I tried a simple command-line application on a MySQL data table
> > > with just one row. All the application does is, first connect to
> > > the database, and then 'MyResult = hConn.Exec("select * from
> > > users")'
> > >
> > > A For Each loop prints the field names just fine. And, 'Print
> > > MyResult!id' displays the correct value.
> > >
> > > Perhaps there is a bug in the Gambas PostgreSQL driver. Can you
> > > test on a MySQL table to see if that works for you?
> > >
> >
> > I agree that the original code should have worked. See the attached
> > script which uses an in-memory SQLite3 database to demonstrate that
> > it works with another driver.
> >
> > A (minimal!) project and database dump, just enough to reproduce
> > the
> > behaviour, would be helpful.
> >
> > Regards,
> > Tobi
>
> I installed a PostgreSQL server. PostgreSQL does not appear at first
> glance to be as easy to work with as MySQL.
>
> After finally figuring out how to configure and use it, I was able to
> run a simple command-line application to successfully
> print the field names. (Interestingly enough, even without the
> gb.db.postgresql database driver component enabled! Beno?t?)
>
> It does work as you expect it should, Doug.
>
> You will find my code and the output below.
>
>
Thanks Lee and Tobi (and others) for sticking with me on this.
I can now report s follows:
For a PostgreSQL object on my machine:
An indexed For ... Next loop works fine
A For Each ... Next always fails at the first line - see attached
image. Gambas is reporting it can't find a field of a given name, but
it has to have found it in order to report its name.
For a MySQL (MariaDB) connection on my machine, both forms of loop work
fine.
Using the Connection option from the project window, I can see and
browse all data in both types of database.
So, it appears to be a glitch in the way the code is executed in a For
Each loop on a PostgreSQL object. Having said that. I have previously
had issues with executables from the Fedora repositories misbehaving,
so I installed Gambas from the Gambas repositories instead and proved
the issue was still there.
Lee has reported different behaviour, so something is definitely screwy
on my system. Sigh.
How do I prepare my project and transmit it to the list?
Kind regards,
Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Gambas screenshot showing error message from For Each loop.png
Type: image/png
Size: 16542 bytes
Desc: not available
URL:
From owlbrudder at gmail.com Mon Jan 1 08:47:08 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Mon, 01 Jan 2018 17:47:08 +1000
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To: <1514787574.3338.6.camel@gmail.com>
References: <1514684664.12546.82.camel@gmail.com>
<1514685624.12546.84.camel@gmail.com>
<1514701561.12546.114.camel@gmail.com>
<8c776eb0-44f9-bf27-ddbf-a671ea9774d2@gmail.com>
<20171231201643.GB21012@highrise.localdomain>
<2263ed80-159d-a85b-ac73-fd5b5cae90af@gmail.com>
<1514787574.3338.6.camel@gmail.com>
Message-ID: <1514792828.3338.25.camel@gmail.com>
On Mon, 2018-01-01 at 16:19 +1000, Doug Hutcheson wrote:
> On Sun, 2017-12-31 at 16:23 -0500, T Lee Davidson wrote:
> > On 12/31/2017 03:16 PM, Tobias Boege wrote:
> > > On Sun, 31 Dec 2017, T Lee Davidson wrote:
> > > > Yes, MyResult!txtMasterDatabase should work. (Did you
> > > > copy/paste that name, or type it in directly?) The For Each
> > > > loop should
> > > > work as well.
> > > >
> > > > I tried a simple command-line application on a MySQL data table
> > > > with just one row. All the application does is, first connect
> > > > to
> > > > the database, and then 'MyResult = hConn.Exec("select * from
> > > > users")'
> > > >
> > > > A For Each loop prints the field names just fine. And, 'Print
> > > > MyResult!id' displays the correct value.
> > > >
> > > > Perhaps there is a bug in the Gambas PostgreSQL driver. Can you
> > > > test on a MySQL table to see if that works for you?
> > > >
> > >
> > > I agree that the original code should have worked. See the
> > > attached
> > > script which uses an in-memory SQLite3 database to demonstrate
> > > that
> > > it works with another driver.
> > >
> > > A (minimal!) project and database dump, just enough to reproduce
> > > the
> > > behaviour, would be helpful.
> > >
> > > Regards,
> > > Tobi
> >
> > I installed a PostgreSQL server. PostgreSQL does not appear at
> > first glance to be as easy to work with as MySQL.
> >
> > After finally figuring out how to configure and use it, I was able
> > to run a simple command-line application to successfully
> > print the field names. (Interestingly enough, even without the
> > gb.db.postgresql database driver component enabled! Beno?t?)
> >
> > It does work as you expect it should, Doug.
> >
> > You will find my code and the output below.
> >
> >
> Thanks Lee and Tobi (and others) for sticking with me on this.
>
> I can now report s follows:
>
> For a PostgreSQL object on my machine:
> An indexed For ... Next loop works fine
> A For Each ... Next always fails at the first line - see attached
> image. Gambas is reporting it can't find a field of a given name, but
> it has to have found it in order to report its name.
>
> For a MySQL (MariaDB) connection on my machine, both forms of loop
> work fine.
>
> Using the Connection option from the project window, I can see and
> browse all data in both types of database.
>
> So, it appears to be a glitch in the way the code is executed in a
> For Each loop on a PostgreSQL object. Having said that. I have
> previously had issues with executables from the Fedora repositories
> misbehaving, so I installed Gambas from the Gambas repositories
> instead and proved the issue was still there.
>
> Lee has reported different behaviour, so something is definitely
> screwy on my system. Sigh.
>
> How do I prepare my project and transmit it to the list?
>
> Kind regards,
> Doug
>
Hi everyone. Another piece of the puzzle, I think:
I have a Database Application where I have been experiencing the above
problems. Within this application I have one form which I have hardly
been using. I have also created two Connections, one for my PostgreSQL
database and one for my MySql database.
As the two connections are able to browse their respective databases,
it seemed logical that controls using these connections would work
also. I created a DataSource control on my form and set its Connection
property to Connection1 (my PostgreSQL database). When I run the
project, I am told "Cannot open database: fe_sendauth: no password
supplied". I then set the Connection property to Connection2 (my MySql
connection). When I run the project I am told "Cannot open database:
Access denied for user 'root'@'localhost' (using password: NO)"
Why am I seeing these password problems when the Connection objects
they are using connect perfectly?
It seems to me I have some kind of data access issue related to my
specific installation, because others are not reporting these.
Incidentally, the data-aware controls look excellent! I will be able to
develop my applications faster that I had imagined.
I have reverted to using Gambas 3.10.0 from the Fedora 28 repositories,
to eliminate any finger fumbles I may have had when compiling from
source. If requested, I can switch back again.
Cheers,
Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From t.lee.davidson at gmail.com Mon Jan 1 18:17:16 2018
From: t.lee.davidson at gmail.com (T Lee Davidson)
Date: Mon, 1 Jan 2018 12:17:16 -0500
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To: <1514792828.3338.25.camel@gmail.com>
References: <1514684664.12546.82.camel@gmail.com>
<1514685624.12546.84.camel@gmail.com> <1514701561.12546.114.camel@gmail.com>
<8c776eb0-44f9-bf27-ddbf-a671ea9774d2@gmail.com>
<20171231201643.GB21012@highrise.localdomain>
<2263ed80-159d-a85b-ac73-fd5b5cae90af@gmail.com>
<1514787574.3338.6.camel@gmail.com> <1514792828.3338.25.camel@gmail.com>
Message-ID: <5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
On 01/01/2018 02:47 AM, Doug Hutcheson wrote:
>
> On Mon, 2018-01-01 at 16:19 +1000, Doug Hutcheson wrote:
>>
[snip]
>>
>> How do I prepare my project and transmit it to the list?
Go to Project > Make > Source archive...
You could put a pared down database dump file in the project directory before making an archive, so that others could more
easily re-create it from that SQL file.
> Hi everyone. Another piece of the puzzle, I think:
>
> I have a Database Application where I have been experiencing the above problems. Within this application I have one form which I
> have hardly been using. I have also created two Connections, one for my PostgreSQL database and one for my MySql database.
>
> As the two connections are able to browse their respective databases, it seemed logical that controls using these connections
> would work also. I created a DataSource control on my form and set its Connection property to Connection1 (my PostgreSQL
> database). When I run the project, I am told "Cannot open database: fe_sendauth: no password supplied". I then set the
> Connection property to Connection2 (my MySql connection). When I run the project I am told "Cannot open database: Access denied
> for user 'root'@'localhost' (using password: NO)"
>
> Why am I seeing these password problems when the Connection objects they are using connect perfectly?
Good question. I am having a similar issue, but all I get is "Cannot open database:" - no reason given. "Common.CheckDB.34" tops
the Stack backtrace.
I don't know if it's related, but when I set the properties for the Connection, I did not enable "Remember password". Yet, I got
an error message, "Unable to save password. Cannot store passwords on desktop KDE5: No wallet found". The error is correct;
there is no wallet. But I shouldn't have gotten any error because I did not elect to save the password.
The Connection can read the database statically through the IDE, but apparently not at runtime.
--
Lee
From t.lee.davidson at gmail.com Mon Jan 1 18:34:55 2018
From: t.lee.davidson at gmail.com (T Lee Davidson)
Date: Mon, 1 Jan 2018 12:34:55 -0500
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To: <5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
References: <1514684664.12546.82.camel@gmail.com>
<1514685624.12546.84.camel@gmail.com> <1514701561.12546.114.camel@gmail.com>
<8c776eb0-44f9-bf27-ddbf-a671ea9774d2@gmail.com>
<20171231201643.GB21012@highrise.localdomain>
<2263ed80-159d-a85b-ac73-fd5b5cae90af@gmail.com>
<1514787574.3338.6.camel@gmail.com> <1514792828.3338.25.camel@gmail.com>
<5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
Message-ID: <84aadabe-1831-c379-6611-82bf4dbd8c26@gmail.com>
On 01/01/2018 12:17 PM, T Lee Davidson wrote:
> On 01/01/2018 02:47 AM, Doug Hutcheson wrote:
[snip]
>>
>> Why am I seeing these password problems when the Connection objects they are using connect perfectly?
>
> Good question. I am having a similar issue, but all I get is "Cannot open database:" - no reason given. "Common.CheckDB.34" tops
> the Stack backtrace.
>
> I don't know if it's related, but when I set the properties for the Connection, I did not enable "Remember password". Yet, I got
> an error message, "Unable to save password. Cannot store passwords on desktop KDE5: No wallet found". The error is correct;
> there is no wallet. But I shouldn't have gotten any error because I did not elect to save the password.
>
> The Connection can read the database statically through the IDE, but apparently not at runtime.
BTW, Doug, did you try the command line application version I posted? Or, in your graphical application, you could try setting
the database connection programmatically to bypass the IDE's Connection component as that appears it might have issues (or we're
doing something wrong).
[code]
' Gambas module file
Public Sub Main()
Dim hConn As New Connection
Dim rField As ResultField
Dim MyResult As Result
hConn.Type = "postgresql" ' Type of connection
hConn.Host = "localhost" ' Name of the server
hConn.Login = "postgres" ' User's name for the connection
hConn.Port = "5432" ' Port to use in the connection, usually 3306
hConn.Name = "postgres" ' Name of the database we want to use
hConn.Password = "mypgpass" ' User's password
hConn.Open() ' Open the connection
If Error Then
Print "OUCH!!"
Else
Print "Connected."
Endif
MyResult = hConn.Exec("select * from users")
Debug MyResult.Fields.Count
Debug MyResult!id
For Each rField In MyResult.Fields
Print rField.Name
Next
End
[/code]
--
Lee
From owlbrudder at gmail.com Tue Jan 2 04:00:32 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Tue, 02 Jan 2018 13:00:32 +1000
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To: <84aadabe-1831-c379-6611-82bf4dbd8c26@gmail.com>
References: <1514684664.12546.82.camel@gmail.com>
<1514685624.12546.84.camel@gmail.com>
<1514701561.12546.114.camel@gmail.com>
<8c776eb0-44f9-bf27-ddbf-a671ea9774d2@gmail.com>
<20171231201643.GB21012@highrise.localdomain>
<2263ed80-159d-a85b-ac73-fd5b5cae90af@gmail.com>
<1514787574.3338.6.camel@gmail.com> <1514792828.3338.25.camel@gmail.com>
<5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
<84aadabe-1831-c379-6611-82bf4dbd8c26@gmail.com>
Message-ID: <1514862032.3338.40.camel@gmail.com>
On Mon, 2018-01-01 at 12:34 -0500, T Lee Davidson wrote:
> On 01/01/2018 12:17 PM, T Lee Davidson wrote:
> > On 01/01/2018 02:47 AM, Doug Hutcheson wrote:
>
> [snip]
> > > Why am I seeing these password problems when the Connection
> > > objects they are using connect perfectly?
> >
> > Good question. I am having a similar issue, but all I get is
> > "Cannot open database:" - no reason given. "Common.CheckDB.34" tops
> > the Stack backtrace.
> >
> > I don't know if it's related, but when I set the properties for the
> > Connection, I did not enable "Remember password". Yet, I got
> > an error message, "Unable to save password. Cannot store passwords
> > on desktop KDE5: No wallet found". The error is correct;
> > there is no wallet. But I shouldn't have gotten any error because I
> > did not elect to save the password.
> >
> > The Connection can read the database statically through the IDE,
> > but apparently not at runtime.
>
> BTW, Doug, did you try the command line application version I posted?
> Or, in your graphical application, you could try setting
> the database connection programmatically to bypass the IDE's
> Connection component as that appears it might have issues (or we're
> doing something wrong).
>
> [code]
> ' Gambas module file
>
> Public Sub Main()
>
> Dim hConn As New Connection
> Dim rField As ResultField
> Dim MyResult As Result
>
> hConn.Type = "postgresql" ' Type of connection
> hConn.Host = "localhost" ' Name of the server
> hConn.Login = "postgres" ' User's name for the connection
> hConn.Port = "5432" ' Port to use in the connection, usually
> 3306
> hConn.Name = "postgres" ' Name of the database we want to use
> hConn.Password = "mypgpass" ' User's password
> hConn.Open() ' Open the connection
> If Error Then
> Print "OUCH!!"
> Else
> Print "Connected."
> Endif
>
> MyResult = hConn.Exec("select * from users")
>
> Debug MyResult.Fields.Count
> Debug MyResult!id
> For Each rField In MyResult.Fields
> Print rField.Name
> Next
>
> End
> [/code]
>
Hi Lee. Your code as it stands reports:[doug at womble
CommandLinePostgreSQLtestApp]$ ./CommandLinePostgreSQLtestApp.gambas Connected.Main.Main.22: Query failed: ERROR: relation "users" does not existLINE 1: select * from users ^
Main.Main.22 [doug at womble CommandLinePostgreSQLtestApp]$
I changed the code to connect to my database and the following was the
output:[doug at womble CommandLinePostgreSQLtestApp]$
./CommandLinePostgreSQLtestApp.gambas Connected.Main.Main.24:
35Main.Main.25: Main.Main.25: Unknown field:
txtMasterDatabaseMain.Main.25
35 is the correct field count; txtMasterDatabase is the first field in
the table.
I have attached two source archives: one is my PostgreSQL test
application - the one which started this thread - and the other is your
command line application. Please feel free to point out if I have done
something stupid, because I am at the start of my Gambas learning curve
and welcome any input.
Regards, Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CommandLinePostgreSQLtestApp-0.0.3.tar.gz
Type: application/x-compressed-tar
Size: 239865 bytes
Desc: not available
URL:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PostgreSQL_test-0.0.1.tar.gz
Type: application/x-compressed-tar
Size: 12506 bytes
Desc: not available
URL:
From t.lee.davidson at gmail.com Tue Jan 2 05:12:13 2018
From: t.lee.davidson at gmail.com (T Lee Davidson)
Date: Mon, 1 Jan 2018 23:12:13 -0500
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To: <1514862032.3338.40.camel@gmail.com>
References: <1514684664.12546.82.camel@gmail.com>
<1514685624.12546.84.camel@gmail.com> <1514701561.12546.114.camel@gmail.com>
<8c776eb0-44f9-bf27-ddbf-a671ea9774d2@gmail.com>
<20171231201643.GB21012@highrise.localdomain>
<2263ed80-159d-a85b-ac73-fd5b5cae90af@gmail.com>
<1514787574.3338.6.camel@gmail.com> <1514792828.3338.25.camel@gmail.com>
<5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
<84aadabe-1831-c379-6611-82bf4dbd8c26@gmail.com>
<1514862032.3338.40.camel@gmail.com>
Message-ID:
On 01/01/2018 10:00 PM, Doug Hutcheson wrote:
> I changed the code to connect to my database and the following was the output:
> [doug at womble CommandLinePostgreSQLtestApp]$ ./CommandLinePostgreSQLtestApp.gambas?
> Connected.
> Main.Main.24: 35
> Main.Main.25: Main.Main.25: Unknown field: txtMasterDatabase
> Main.Main.25?
>
> 35 is the correct field count; txtMasterDatabase is the first field in the table.
>
> I have attached two source archives: one is my PostgreSQL test application - the one which started this thread - and the other
> is your command line application. Please feel free to point out if I have done something stupid, because I am at the start of my
> Gambas learning curve and welcome any input.
>
Looking at the name of the first field in the table reminded me of something I stumbled across during my foray into PostgreSQL
land. It has an issue with mixed-case names.
https://stackoverflow.com/questions/20878932/are-postgresql-column-names-case-sensitive :
"All identifiers (including column names) that are not double-quoted are folded to lower case in PostgreSQL."
--
Lee
From owlbrudder at gmail.com Tue Jan 2 05:34:47 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Tue, 02 Jan 2018 14:34:47 +1000
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To:
References: <1514684664.12546.82.camel@gmail.com>
<1514685624.12546.84.camel@gmail.com>
<1514701561.12546.114.camel@gmail.com>
<8c776eb0-44f9-bf27-ddbf-a671ea9774d2@gmail.com>
<20171231201643.GB21012@highrise.localdomain>
<2263ed80-159d-a85b-ac73-fd5b5cae90af@gmail.com>
<1514787574.3338.6.camel@gmail.com> <1514792828.3338.25.camel@gmail.com>
<5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
<84aadabe-1831-c379-6611-82bf4dbd8c26@gmail.com>
<1514862032.3338.40.camel@gmail.com>
Message-ID: <1514867687.4301.5.camel@gmail.com>
On Mon, 2018-01-01 at 23:12 -0500, T Lee Davidson wrote:
> On 01/01/2018 10:00 PM, Doug Hutcheson wrote:
> > I changed the code to connect to my database and the following was
> > the output:
> > [doug at womble CommandLinePostgreSQLtestApp]$
> > ./CommandLinePostgreSQLtestApp.gambas
> > Connected.
> > Main.Main.24: 35
> > Main.Main.25: Main.Main.25: Unknown field: txtMasterDatabase
> > Main.Main.25
> >
> > 35 is the correct field count; txtMasterDatabase is the first field
> > in the table.
> >
> > I have attached two source archives: one is my PostgreSQL test
> > application - the one which started this thread - and the other
> > is your command line application. Please feel free to point out if
> > I have done something stupid, because I am at the start of my
> > Gambas learning curve and welcome any input.
> >
>
> Looking at the name of the first field in the table reminded me of
> something I stumbled across during my foray into PostgreSQL
> land. It has an issue with mixed-case names.
>
> https://stackoverflow.com/questions/20878932/are-postgresql-column-na
> mes-case-sensitive :
> "All identifiers (including column names) that are not double-quoted
> are folded to lower case in PostgreSQL."
>
>
Darn! I knew about that restriction and commonly double-quote my
identifiers for that reason. Sure 'nuff, when I change the first field
name to all lower-case the loop works fine, then barfs on the next one
which I have not changed.
Looks like you have solved that much of the quandary for me, Lee. Give
yourself a gold star and an elephant stamp! "8-)
Now I will see if it solves the problem of the Connections not wanting
to play nicely. I'll get back to you on that.
Cheers, Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From owlbrudder at gmail.com Tue Jan 2 06:18:00 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Tue, 02 Jan 2018 15:18:00 +1000
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To: <1514867687.4301.5.camel@gmail.com>
References: <1514684664.12546.82.camel@gmail.com>
<1514685624.12546.84.camel@gmail.com>
<1514701561.12546.114.camel@gmail.com>
<8c776eb0-44f9-bf27-ddbf-a671ea9774d2@gmail.com>
<20171231201643.GB21012@highrise.localdomain>
<2263ed80-159d-a85b-ac73-fd5b5cae90af@gmail.com>
<1514787574.3338.6.camel@gmail.com> <1514792828.3338.25.camel@gmail.com>
<5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
<84aadabe-1831-c379-6611-82bf4dbd8c26@gmail.com>
<1514862032.3338.40.camel@gmail.com>
<1514867687.4301.5.camel@gmail.com>
Message-ID: <1514870280.4301.14.camel@gmail.com>
On Tue, 2018-01-02 at 14:34 +1000, Doug Hutcheson wrote:
> On Mon, 2018-01-01 at 23:12 -0500, T Lee Davidson wrote:
> > On 01/01/2018 10:00 PM, Doug Hutcheson wrote:
> > > I changed the code to connect to my database and the following
> > > was the output:
> > > [doug at womble CommandLinePostgreSQLtestApp]$
> > > ./CommandLinePostgreSQLtestApp.gambas
> > > Connected.
> > > Main.Main.24: 35
> > > Main.Main.25: Main.Main.25: Unknown field: txtMasterDatabase
> > > Main.Main.25
> > >
> > > 35 is the correct field count; txtMasterDatabase is the first
> > > field in the table.
> > >
> > > I have attached two source archives: one is my PostgreSQL test
> > > application - the one which started this thread - and the other
> > > is your command line application. Please feel free to point out
> > > if I have done something stupid, because I am at the start of my
> > > Gambas learning curve and welcome any input.
> > >
> >
> > Looking at the name of the first field in the table reminded me of
> > something I stumbled across during my foray into PostgreSQL
> > land. It has an issue with mixed-case names.
> >
> > https://stackoverflow.com/questions/20878932/are-postgresql-column-
> > names-case-sensitive :
> > "All identifiers (including column names) that are not double-
> > quoted are folded to lower case in PostgreSQL."
> >
> >
> Darn! I knew about that restriction and commonly double-quote my
> identifiers for that reason. Sure 'nuff, when I change the first
> field name to all lower-case the loop works fine, then barfs on the
> next one which I have not changed.
>
> Looks like you have solved that much of the quandary for me, Lee.
> Give yourself a gold star and an elephant stamp! "8-)
>
> Now I will see if it solves the problem of the Connections not
> wanting to play nicely. I'll get back to you on that.
>
> Cheers, Doug
Hi Lee. Nope, it does not help with the Connections problem. My
Connections tool correctly shows all my tables and browses my data, but
attempting to use a Connection with a Datasource control and giving it
a tablename visible in the Connections tool, causes the error "Cannot
open database: fe_sendauth: no password supplied".
I am a retired C and VBA programmer with more time than sense, so I'll
poke around in the Gambas source (gb.db, gb.db.mysql, gb.db.postgresql
for a start) and see what I can see. The field names issue might just
be a matter of double-quoting each time a field is accessed and the
password issue seems to be common to MySql and PostgreSQL so is going
to be something obvious. I'll let you know if I find anything
interesting.
Cheers, Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From owlbrudder at gmail.com Tue Jan 2 07:30:40 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Tue, 02 Jan 2018 16:30:40 +1000
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To: <1514870280.4301.14.camel@gmail.com>
References: <1514684664.12546.82.camel@gmail.com>
<1514685624.12546.84.camel@gmail.com>
<1514701561.12546.114.camel@gmail.com>
<8c776eb0-44f9-bf27-ddbf-a671ea9774d2@gmail.com>
<20171231201643.GB21012@highrise.localdomain>
<2263ed80-159d-a85b-ac73-fd5b5cae90af@gmail.com>
<1514787574.3338.6.camel@gmail.com> <1514792828.3338.25.camel@gmail.com>
<5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
<84aadabe-1831-c379-6611-82bf4dbd8c26@gmail.com>
<1514862032.3338.40.camel@gmail.com>
<1514867687.4301.5.camel@gmail.com> <1514870280.4301.14.camel@gmail.com>
Message-ID: <1514874640.4301.29.camel@gmail.com>
On Tue, 2018-01-02 at 15:18 +1000, Doug Hutcheson wrote:
> On Tue, 2018-01-02 at 14:34 +1000, Doug Hutcheson wrote:
> > On Mon, 2018-01-01 at 23:12 -0500, T Lee Davidson wrote:
> > > On 01/01/2018 10:00 PM, Doug Hutcheson wrote:
> > > > I changed the code to connect to my database and the following
> > > > was the output:
> > > > [doug at womble
> > > > CommandLinePostgreSQLtestApp]$
> > > > ./CommandLinePostgreSQLtestApp.gambas
> > > > Connected.
> > > > Main.Main.24: 35
> > > > Main.Main.25: Main.Main.25: Unknown field: txtMasterDatabase
> > > > Main.Main.25
> > > >
> > > > 35 is the correct field count; txtMasterDatabase is the first
> > > > field in the table.
> > > >
> > > > I have attached two source archives: one is my PostgreSQL test
> > > > application - the one which started this thread - and the other
> > > > is your command line application. Please feel free to point out
> > > > if I have done something stupid, because I am at the start of
> > > > my
> > > > Gambas learning curve and welcome any input.
> > > >
> > >
> > > Looking at the name of the first field in the table reminded me
> > > of something I stumbled across during my foray into PostgreSQL
> > > land. It has an issue with mixed-case names.
> > >
> > > https://stackoverflow.com/questions/20878932/are-postgresql-colum
> > > n-names-case-sensitive :
> > > "All identifiers (including column names) that are not double-
> > > quoted are folded to lower case in PostgreSQL."
> > >
> > >
> > Darn! I knew about that restriction and commonly double-quote my
> > identifiers for that reason. Sure 'nuff, when I change the first
> > field name to all lower-case the loop works fine, then barfs on the
> > next one which I have not changed.
> >
> > Looks like you have solved that much of the quandary for me, Lee.
> > Give yourself a gold star and an elephant stamp! "8-)
> >
> > Now I will see if it solves the problem of the Connections not
> > wanting to play nicely. I'll get back to you on that.
> >
> > Cheers, Doug
>
> Hi Lee. Nope, it does not help with the Connections problem. My
> Connections tool correctly shows all my tables and browses my data,
> but attempting to use a Connection with a Datasource control and
> giving it a tablename visible in the Connections tool, causes the
> error "Cannot open database: fe_sendauth: no password supplied".
>
> I am a retired C and VBA programmer with more time than sense, so
> I'll poke around in the Gambas source (gb.db, gb.db.mysql,
> gb.db.postgresql for a start) and see what I can see. The field names
> issue might just be a matter of double-quoting each time a field is
> accessed and the password issue seems to be common to MySql and
> PostgreSQL so is going to be something obvious. I'll let you know if
> I find anything interesting.
> Cheers, Doug
Hi Lee.
A first look at the code tells me three things:
1. gb.db.postgresql/main.c contains code to quote identifiers, but I
will have to look further to determine whether it uses a single quote
or a double quote. Suspicious, but needs more investigation. If it uses
a sinle quote, that will be our problem right there.
2. Both gb.db.mysql/main.c and gb.db.postgresql/main.c have a routine
to open a database. In each case, the parameters - including password -
are contained in a structure passed to the routine. I will have to dig
more to determine whether the password is actually being passed. Logic
says it must be, because others would have tripped over this problem in
the past, but the evidence on my machine at least suggests the password
is not being correctly embedded in the structure.
3. I don't seem to have the source for gb.db, which is where I expect
to find some of the high-level code and structures. Will dig more.
Now, before I go any further, I don't want to be treading on anyone's
toes. If it is not my place to go ferreting around in the code please
let me know - the last thing I want is to give anyone offence.
If it is OK, I will gladly dive in and see what I can contribute.
Cheers, Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From taboege at gmail.com Tue Jan 2 07:38:44 2018
From: taboege at gmail.com (Tobias Boege)
Date: Tue, 2 Jan 2018 07:38:44 +0100
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To: <1514874640.4301.29.camel@gmail.com>
References: <2263ed80-159d-a85b-ac73-fd5b5cae90af@gmail.com>
<1514787574.3338.6.camel@gmail.com>
<1514792828.3338.25.camel@gmail.com>
<5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
<84aadabe-1831-c379-6611-82bf4dbd8c26@gmail.com>
<1514862032.3338.40.camel@gmail.com>
<1514867687.4301.5.camel@gmail.com>
<1514870280.4301.14.camel@gmail.com>
<1514874640.4301.29.camel@gmail.com>
Message-ID: <20180102063844.GC21012@highrise.localdomain>
On Tue, 02 Jan 2018, Doug Hutcheson wrote:
> 3. I don't seem to have the source for gb.db, which is where I expect
> to find some of the high-level code and structures. Will dig more.
>
The common gb.db code is in main/lib/db.
> Now, before I go any further, I don't want to be treading on anyone's
> toes. If it is not my place to go ferreting around in the code please
> let me know - the last thing I want is to give anyone offence.
>
By all means, do what you can.
Regards,
Tobi
--
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
From owlbrudder at gmail.com Tue Jan 2 07:40:22 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Tue, 02 Jan 2018 16:40:22 +1000
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To: <20180102063844.GC21012@highrise.localdomain>
References: <2263ed80-159d-a85b-ac73-fd5b5cae90af@gmail.com>
<1514787574.3338.6.camel@gmail.com> <1514792828.3338.25.camel@gmail.com>
<5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
<84aadabe-1831-c379-6611-82bf4dbd8c26@gmail.com>
<1514862032.3338.40.camel@gmail.com>
<1514867687.4301.5.camel@gmail.com> <1514870280.4301.14.camel@gmail.com>
<1514874640.4301.29.camel@gmail.com>
<20180102063844.GC21012@highrise.localdomain>
Message-ID: <1514875222.4301.30.camel@gmail.com>
On Tue, 2018-01-02 at 07:38 +0100, Tobias Boege wrote:
> On Tue, 02 Jan 2018, Doug Hutcheson wrote:
> > 3. I don't seem to have the source for gb.db, which is where I
> > expect
> > to find some of the high-level code and structures. Will dig more.
> >
>
> The common gb.db code is in main/lib/db.
>
> > Now, before I go any further, I don't want to be treading on
> > anyone's
> > toes. If it is not my place to go ferreting around in the code
> > please
> > let me know - the last thing I want is to give anyone offence.
> >
>
> By all means, do what you can.
>
> Regards,
> Tobi
>
>
Thank you Tobi. So, my adventure into the code begins ...
Cheers, Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From owlbrudder at gmail.com Tue Jan 2 08:59:59 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Tue, 02 Jan 2018 17:59:59 +1000
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To: <1514875222.4301.30.camel@gmail.com>
References: <2263ed80-159d-a85b-ac73-fd5b5cae90af@gmail.com>
<1514787574.3338.6.camel@gmail.com> <1514792828.3338.25.camel@gmail.com>
<5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
<84aadabe-1831-c379-6611-82bf4dbd8c26@gmail.com>
<1514862032.3338.40.camel@gmail.com>
<1514867687.4301.5.camel@gmail.com> <1514870280.4301.14.camel@gmail.com>
<1514874640.4301.29.camel@gmail.com>
<20180102063844.GC21012@highrise.localdomain>
<1514875222.4301.30.camel@gmail.com>
Message-ID: <1514879999.4301.34.camel@gmail.com>
On Tue, 2018-01-02 at 16:40 +1000, Doug Hutcheson wrote:
> On Tue, 2018-01-02 at 07:38 +0100, Tobias Boege wrote:
> > On Tue, 02 Jan 2018, Doug Hutcheson wrote:
> > > 3. I don't seem to have the source for gb.db, which is where I
> > > expect
> > > to find some of the high-level code and structures. Will dig
> > > more.
> > >
> >
> > The common gb.db code is in main/lib/db.
> >
> > > Now, before I go any further, I don't want to be treading on
> > > anyone's
> > > toes. If it is not my place to go ferreting around in the code
> > > please
> > > let me know - the last thing I want is to give anyone offence.
> > >
> >
> > By all means, do what you can.
> >
> > Regards,
> > Tobi
> >
> Thank you Tobi. So, my adventure into the code begins ...
> Cheers, Doug
I can confirm the PostgreSQL quote character is correctly declared as "
, so that is one line of investigation closed. Still digging ... "8-)
Cheers, Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From t.lee.davidson at gmail.com Tue Jan 2 17:41:37 2018
From: t.lee.davidson at gmail.com (T Lee Davidson)
Date: Tue, 2 Jan 2018 11:41:37 -0500
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To: <1514870280.4301.14.camel@gmail.com>
References: <1514684664.12546.82.camel@gmail.com>
<1514685624.12546.84.camel@gmail.com> <1514701561.12546.114.camel@gmail.com>
<8c776eb0-44f9-bf27-ddbf-a671ea9774d2@gmail.com>
<20171231201643.GB21012@highrise.localdomain>
<2263ed80-159d-a85b-ac73-fd5b5cae90af@gmail.com>
<1514787574.3338.6.camel@gmail.com> <1514792828.3338.25.camel@gmail.com>
<5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
<84aadabe-1831-c379-6611-82bf4dbd8c26@gmail.com>
<1514862032.3338.40.camel@gmail.com>
<1514867687.4301.5.camel@gmail.com> <1514870280.4301.14.camel@gmail.com>
Message-ID:
On 01/02/2018 12:18 AM, Doug Hutcheson wrote:
> Hi Lee. Nope, it does not help with the Connections problem. My Connections tool correctly shows all my tables and browses my
> data, but attempting to use a Connection with a Datasource control and giving it a tablename visible in the Connections tool,
> causes the error "Cannot open database: fe_sendauth: no password supplied".
It's not just PostgreSQL. It happens to me with and IDE-defined MySQL Connection.
When I run a simple test program, I get, "Cannot open database:" - no reason given. I believe that error message, in the case of
MySQL, is generated by line 775 of gb.db.mysql.
(https://gitlab.com/gambas/gambas/blob/master/gb.db.mysql/src/main.c#L775)
The 'Local variables' tab shows "hConn (Connection 0xss6faa8)". Examining that object by double-clicking it shows that the
Password property is empty.
--
Lee
From owlbrudder at gmail.com Tue Jan 2 23:56:04 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Wed, 03 Jan 2018 08:56:04 +1000
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To:
References: <1514684664.12546.82.camel@gmail.com>
<1514685624.12546.84.camel@gmail.com>
<1514701561.12546.114.camel@gmail.com>
<8c776eb0-44f9-bf27-ddbf-a671ea9774d2@gmail.com>
<20171231201643.GB21012@highrise.localdomain>
<2263ed80-159d-a85b-ac73-fd5b5cae90af@gmail.com>
<1514787574.3338.6.camel@gmail.com> <1514792828.3338.25.camel@gmail.com>
<5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
<84aadabe-1831-c379-6611-82bf4dbd8c26@gmail.com>
<1514862032.3338.40.camel@gmail.com>
<1514867687.4301.5.camel@gmail.com> <1514870280.4301.14.camel@gmail.com>
Message-ID: <1514933764.4301.48.camel@gmail.com>
On Tue, 2018-01-02 at 11:41 -0500, T Lee Davidson wrote:
> On 01/02/2018 12:18 AM, Doug Hutcheson wrote:
> > Hi Lee. Nope, it does not help with the Connections problem. My
> > Connections tool correctly shows all my tables and browses my
> > data, but attempting to use a Connection with a Datasource control
> > and giving it a tablename visible in the Connections tool,
> > causes the error "Cannot open database: fe_sendauth: no password
> > supplied".
>
> It's not just PostgreSQL. It happens to me with and IDE-defined MySQL
> Connection.
>
> When I run a simple test program, I get, "Cannot open database:" - no
> reason given. I believe that error message, in the case of
> MySQL, is generated by line 775 of gb.db.mysql.
> (https://gitlab.com/gambas/gambas/blob/master/gb.db.mysql/src/main.c#
> L775)
>
I agree - that seems to be the line. (Takes note to self: must learn
how to use gitlab ...) The corresponding line in the gb.db.postgresql
source is 720, although the surrounding code is quite different. Still,
both must have been working (?) so the mission is to discover what has
changed.
> The 'Local variables' tab shows "hConn (Connection 0xss6faa8)".
> Examining that object by double-clicking it shows that the
> Password property is empty.
>
That is consistent with what is happening for me, but I had not gone as
far as debugging the hConn variable.
So, there are two issues to address:
1. Why are PostgreSQL table and column names not recognised if mixed
case - probably not being double quoted even though the code is there?
2. Why are passwords not being passed?
At least we are both seeing identical problems, so I can eliminate my
own setup as being at fault.
Gambas is a big beast to get the head around, but the code is
beautifully written which makes it possible to follow the logic in most
cases. As is always the case, I wish there were more comments. '8-)
Kind regards, Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From owlbrudder at gmail.com Wed Jan 3 00:42:00 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Wed, 03 Jan 2018 09:42:00 +1000
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To: <1514933764.4301.48.camel@gmail.com>
References: <1514684664.12546.82.camel@gmail.com>
<1514685624.12546.84.camel@gmail.com>
<1514701561.12546.114.camel@gmail.com>
<8c776eb0-44f9-bf27-ddbf-a671ea9774d2@gmail.com>
<20171231201643.GB21012@highrise.localdomain>
<2263ed80-159d-a85b-ac73-fd5b5cae90af@gmail.com>
<1514787574.3338.6.camel@gmail.com> <1514792828.3338.25.camel@gmail.com>
<5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
<84aadabe-1831-c379-6611-82bf4dbd8c26@gmail.com>
<1514862032.3338.40.camel@gmail.com>
<1514867687.4301.5.camel@gmail.com> <1514870280.4301.14.camel@gmail.com>
<1514933764.4301.48.camel@gmail.com>
Message-ID: <1514936520.4301.60.camel@gmail.com>
On Wed, 2018-01-03 at 08:56 +1000, Doug Hutcheson wrote:
> On Tue, 2018-01-02 at 11:41 -0500, T Lee Davidson wrote:
> > On 01/02/2018 12:18 AM, Doug Hutcheson wrote:
> > > Hi Lee. Nope, it does not help with the Connections problem. My
> > > Connections tool correctly shows all my tables and browses my
> > > data, but attempting to use a Connection with a Datasource
> > > control and giving it a tablename visible in the Connections
> > > tool,
> > > causes the error "Cannot open database: fe_sendauth: no password
> > > supplied".
> >
> > It's not just PostgreSQL. It happens to me with and IDE-defined
> > MySQL Connection.
> >
> > When I run a simple test program, I get, "Cannot open database:" -
> > no reason given. I believe that error message, in the case of
> > MySQL, is generated by line 775 of gb.db.mysql.
> > (https://gitlab.com/gambas/gambas/blob/master/gb.db.mysql/src/main.
> > c#L775)
> >
> I agree - that seems to be the line. (Takes note to self: must learn
> how to use gitlab ...) The corresponding line in the gb.db.postgresql
> source is 720, although the surrounding code is quite different.
> Still, both must have been working (?) so the mission is to discover
> what has changed.
>
> > The 'Local variables' tab shows "hConn (Connection 0xss6faa8)".
> > Examining that object by double-clicking it shows that the
> > Password property is empty.
> >
> That is consistent with what is happening for me, but I had not gone
> as far as debugging the hConn variable.
>
> So, there are two issues to address:
> 1. Why are PostgreSQL table and column names not recognised if mixed
> case - probably not being double quoted even though the code is
> there?
> 2. Why are passwords not being passed?
>
> At least we are both seeing identical problems, so I can eliminate my
> own setup as being at fault.
>
>
> Gambas is a big beast to get the head around, but the code is
> beautifully written which makes it possible to follow the logic in
> most cases. As is always the case, I wish there were more
> comments. '8-)
>
> Kind regards, Doug
Hi Lee. An interesting piece of code resides in
main/lib/db/CConnection.c lines 315 to 337, which is surrounded by
#ifdef 0 ... #endif and attempts to set a flag indicating whether the
database in question is case sensitive. Clearly the ability for
databases to have identifiers in mixed case has received attention in
the past. My understanding of #ifdef 0 is that it will always fail, so
the code is never included - do you agree? I can't imagine a case where
one would #define 0, but I am willing to be proved wrong "8-)
Is there a better way to collaborate than sending emails to the list?
I'm sure other users must be getting sick of the constant flow of
messages.
Kind regards, Doug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From owlbrudder at gmail.com Wed Jan 3 02:26:44 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Wed, 03 Jan 2018 11:26:44 +1000
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To: <1514933764.4301.48.camel@gmail.com>
References: <1514684664.12546.82.camel@gmail.com>
<1514685624.12546.84.camel@gmail.com>
<1514701561.12546.114.camel@gmail.com>
<8c776eb0-44f9-bf27-ddbf-a671ea9774d2@gmail.com>
<20171231201643.GB21012@highrise.localdomain>
<2263ed80-159d-a85b-ac73-fd5b5cae90af@gmail.com>
<1514787574.3338.6.camel@gmail.com> <1514792828.3338.25.camel@gmail.com>
<5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
<84aadabe-1831-c379-6611-82bf4dbd8c26@gmail.com>
<1514862032.3338.40.camel@gmail.com>
<1514867687.4301.5.camel@gmail.com> <1514870280.4301.14.camel@gmail.com>
<1514933764.4301.48.camel@gmail.com>
Message-ID: <1514942804.4301.71.camel@gmail.com>
On Wed, 2018-01-03 at 08:56 +1000, Doug Hutcheson wrote:
> On Tue, 2018-01-02 at 11:41 -0500, T Lee Davidson wrote:
> > On 01/02/2018 12:18 AM, Doug Hutcheson wrote:
> > > Hi Lee. Nope, it does not help with the Connections problem. My
> > > Connections tool correctly shows all my tables and browses my
> > > data, but attempting to use a Connection with a Datasource
> > > control and giving it a tablename visible in the Connections
> > > tool,
> > > causes the error "Cannot open database: fe_sendauth: no password
> > > supplied".
> >
> > It's not just PostgreSQL. It happens to me with and IDE-defined
> > MySQL Connection.
> >
> > When I run a simple test program, I get, "Cannot open database:" -
> > no reason given. I believe that error message, in the case of
> > MySQL, is generated by line 775 of gb.db.mysql.
> > (https://gitlab.com/gambas/gambas/blob/master/gb.db.mysql/src/main.
> > c#L775)
> >
> I agree - that seems to be the line. (Takes note to self: must learn
> how to use gitlab ...) The corresponding line in the gb.db.postgresql
> source is 720, although the surrounding code is quite different.
> Still, both must have been working (?) so the mission is to discover
> what has changed.
>
> > The 'Local variables' tab shows "hConn (Connection 0xss6faa8)".
> > Examining that object by double-clicking it shows that the
> > Password property is empty.
> >
> That is consistent with what is happening for me, but I had not gone
> as far as debugging the hConn variable.
>
> So, there are two issues to address:
> 1. Why are PostgreSQL table and column names not recognised if mixed
> case - probably not being double quoted even though the code is
> there?
> 2. Why are passwords not being passed?
>
> At least we are both seeing identical problems, so I can eliminate my
> own setup as being at fault.
>
>
> Gambas is a big beast to get the head around, but the code is
> beautifully written which makes it possible to follow the logic in
> most cases. As is always the case, I wish there were more
> comments. '8-)
>
> Kind regards, Doug
Working on the password issue.
I uncommented line 708 of bg.db.postgresql/src/main.c, to allow a debug
statement to be displayed. I recompiled and restarted. Opened the form
with the DataSource control and saw this result:
gb.db.postgresql: host = `localhost` port = `(null)` dbnname =
`dbname='ABPA' connect_timeout=20` user = `doug` password = ``
so the port is not set at that point, which could be the reason the
database is not opening - perhaps?
I then changed Connection1 to point to a different database and
adjusted the relevant properties of the DataSource control. Running it
saw this result:
gb.db.postgresql: host = `localhost` port = `5432` dbnname =
`dbname='softwarebiz' connect_timeout=20` user = `doug` password =
`(null)`
so now the port is correct but the password has gone to the bit bucket.
I wonder whether we are seeing a pointer dereferencing issue with the
DB_DESC structure? Too little information to go on as yet.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From mail.gambaspi at gmail.com Wed Jan 3 05:43:34 2018
From: mail.gambaspi at gmail.com (Zainudin Ahmad)
Date: Wed, 3 Jan 2018 11:43:34 +0700
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To: <1514684664.12546.82.camel@gmail.com>
References: <1514684664.12546.82.camel@gmail.com>
Message-ID:
Hi
You can see this video (
https://drive.google.com/open?id=1jq6I26ykS5Mkr3L2oPA1D15ZtjLt2_S3)
Debug hRes.Fields.Exist("\"TxtMyDb\"") ---> true
Debug hRes.Fields.Exist("TxtMyDb") ----> false
I think gambas not fully support for case sensitive(for postgres) field
name. I don't know about postgres I think maybe the recommended way you
should write your field name with lower case name.
you can see in that video, doing this :
Debug hRes.Fields["name"].name
Debug hRes.Fields["NaMe"].name
it's no different
I think this is also possible :
For Each hRes
Debug hRes!Name
Debug hRes!NaMe
Next
if you doing hRes!txtMasterDatabase or hRes!txtMasterDATABASE or other it's
mean you must have a field name with lower case name in your table.
sorry for my english, I hope that can help.
On Sun, Dec 31, 2017 at 8:44 AM, Doug Hutcheson
wrote:
> Hi everyone.
>
> I have successfully connected to my PostgreSQL database and the field
> count in the Result from my query is correct, but all my attempts to
> extract data from the fields have failed. I am cobbling together code from
> the wiki and from other posts here, but I am still missing something.
>
> The table I am reading from has exactly one row and 35 fields. The first
> field is named txtMasterDatabase.
>
> My code declares a Field and a Result as follows:
> Dim $Field As ResultField
> Dim $Result As Result
>
> The query works correctly:
> $Query = "Select * From abpa.tblParameters"
> $Result = $Con.Exec($Query)
>
> The field count is correct - 35:
> Message("Fields count = " & $Result.Fields.Count)
>
> Now I try to loop through the fields in the result:
> For Each $Field In $Result.Fields
> Message($Field.Name)
> Next
>
> The problem occurs on the For Each line in that the Basic IDE displays an
> error at this point:
> Unknown field: txtMasterDatabase in FRMStart:41
>
> As I said above, the first field in the tuple is named txtMasterDatabase,
> so Gambas is at least seeing it. Why is it telling me the field is unknown?
>
> Thanks for any help and Happy New Year,
> Doug
>
>
> --------------------------------------------------
>
> This is the Gambas Mailing List
> https://lists.gambas-basic.org/listinfo/user
>
> Hosted by https://www.hostsharing.net
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From owlbrudder at gmail.com Wed Jan 3 05:51:32 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Wed, 03 Jan 2018 14:51:32 +1000
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To:
References: <1514684664.12546.82.camel@gmail.com>
Message-ID: <1514955092.4301.75.camel@gmail.com>
Hi Zainudin Ahmad Thanks for the information. I think you are correct,
in that I will have to use lowercase names instead of CamelCase that I
have been using for years. I would still like to know exactly where in
the code I should be looking in order to fix the PostgreSQL interface,
because I am happy to go through the compile/run/debug cycle as often
as needed. "8-)Kind regards, Doug
On Wed, 2018-01-03 at 11:43 +0700, Zainudin Ahmad wrote:
> Hi
>
> You can see this video (https://drive.google.com/open?id=1jq6I26ykS5M
> kr3L2oPA1D15ZtjLt2_S3)
>
> Debug hRes.Fields.Exist("\"TxtMyDb\"") ---> true
> Debug hRes.Fields.Exist("TxtMyDb") ----> false
> I
> think gambas not fully support for case sensitive(for postgres)
> field
> name. I don't know about postgres I think maybe the recommended way
> you should
> write your field name with lower case name.
> you can see in that video, doing this :
> Debug hRes.Fields["name"].name
> Debug hRes.Fields["NaMe"].name
> it's no different
> I think this is also possible :
> For Each hRes
> Debug hRes!Name Debug hRes!NaMe Next
> if
> you doing hRes!txtMasterDatabase or hRes!txtMasterDATABASE or other
> it's mean you must have a field name with lower case name in your
> table.
>
> sorry for my english, I hope that can help.
>
> On Sun, Dec 31, 2017 at 8:44 AM, Doug Hutcheson > wrote:
> > Hi everyone.
> > I have successfully connected to my PostgreSQL database and the
> > field count in the Result from my query is correct, but all my
> > attempts to extract data from the fields have failed. I am cobbling
> > together code from the wiki and from other posts here, but I am
> > still missing something.
> > The table I am reading from has exactly one row and 35 fields. The
> > first field is named txtMasterDatabase.
> > My code declares a Field and a Result as follows: Dim
> > $Field As ResultField Dim $Result As Result
> > The query works correctly: $Query = "Select * From
> > abpa.tblParameters" $Result = $Con.Exec($Query)
> > The field count is correct - 35: Message("Fields count =
> > " & $Result.Fields.Count)
> > Now I try to loop through the fields in the result: For
> > Each $Field In
> > $Result.Fields Message($Field.Name) Next
> > The problem occurs on the For Each line in that the Basic IDE
> > displays an error at this point: Unknown field:
> > txtMasterDatabase in FRMStart:41
> > As I said above, the first field in the tuple is named
> > txtMasterDatabase, so Gambas is at least seeing it. Why is it
> > telling me the field is unknown?
> > Thanks for any help and Happy New Year,Doug
> >
> >
> > --------------------------------------------------
> >
> >
> >
> > This is the Gambas Mailing List
> >
> > https://lists.gambas-basic.org/listinfo/user
> >
> >
> >
> > Hosted by https://www.hostsharing.net
> >
> >
>
>
> --------------------------------------------------
>
> This is the Gambas Mailing List
> https://lists.gambas-basic.org/listinfo/user
>
> Hosted by https://www.hostsharing.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From owlbrudder at gmail.com Wed Jan 3 08:03:36 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Wed, 03 Jan 2018 17:03:36 +1000
Subject: [Gambas-user] What IDE if any to use for development of Gambas?
Message-ID: <1514963016.4301.79.camel@gmail.com>
Hi everyone. I have been wrestling with the Eclipse IDE, but losing the
fight. What do you use for development of Gambas code? (I am not
referring to the Gambas Basic IDE here - I mean for developing Gambas
itself). Thanks, Doug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From bugtracker at gambaswiki.org Wed Jan 3 09:16:52 2018
From: bugtracker at gambaswiki.org (bugtracker at gambaswiki.org)
Date: Wed, 03 Jan 2018 08:16:52 GMT
Subject: [Gambas-user] [Gambas Bug Tracker] Bug #1221: Object explorer
Message-ID:
http://gambaswiki.org/bugtracker/edit?object=BUG.1221&from=L21haW4-
Fabien BODARD reported a new bug.
Summary
-------
Object explorer
Type : Request
Priority : Medium
Gambas version : Master
Product : Development Environment
Description
-----------
Hi,
Why not adding an object explorer on the left side ? It can be usefull to have a way to see for example database fields during the code writting. Or any object content as sometime the auto suggesting don't know the object nature.
I join a snapshot of what it can look like. I anybody have better ideas :-) fill free to discuss.
From bugtracker at gambaswiki.org Wed Jan 3 09:17:47 2018
From: bugtracker at gambaswiki.org (bugtracker at gambaswiki.org)
Date: Wed, 03 Jan 2018 08:17:47 GMT
Subject: [Gambas-user] [Gambas Bug Tracker] Bug #1221: Object explorer
In-Reply-To:
References:
Message-ID:
http://gambaswiki.org/bugtracker/edit?object=BUG.1221&from=L21haW4-
Fabien BODARD added an attachment:
Screenshot_20180103_080703.png
From bugtracker at gambaswiki.org Wed Jan 3 09:36:35 2018
From: bugtracker at gambaswiki.org (bugtracker at gambaswiki.org)
Date: Wed, 03 Jan 2018 08:36:35 GMT
Subject: [Gambas-user] [Gambas Bug Tracker] Bug #1222: Circles on maps
Message-ID:
http://gambaswiki.org/bugtracker/edit?object=BUG.1222&from=L21haW4-
Carlo PANARA reported a new bug.
Summary
-------
Circles on maps
Type : Request
Priority : Medium
Gambas version : 3.10
Product : Unknown
Description
-----------
The possibility (in gb.map) to create circles on a map.
Centre of known latitude and longitude and radius of the circle in meters.
I enclose an example written in java, if it can be useful.
Thank you
From bugtracker at gambaswiki.org Wed Jan 3 09:37:35 2018
From: bugtracker at gambaswiki.org (bugtracker at gambaswiki.org)
Date: Wed, 03 Jan 2018 08:37:35 GMT
Subject: [Gambas-user] [Gambas Bug Tracker] Bug #1222: Circles on maps
In-Reply-To:
References:
Message-ID:
http://gambaswiki.org/bugtracker/edit?object=BUG.1222&from=L21haW4-
Comment #1 by Carlo PANARA:
https://developers.google.com/maps/documentation/javascript/examples/circle-simple
From gambas.fr at gmail.com Wed Jan 3 09:47:57 2018
From: gambas.fr at gmail.com (Fabien Bodard)
Date: Wed, 3 Jan 2018 09:47:57 +0100
Subject: [Gambas-user] What IDE if any to use for development of Gambas?
In-Reply-To: <1514963016.4301.79.camel@gmail.com>
References: <1514963016.4301.79.camel@gmail.com>
Message-ID:
2018-01-03 8:03 GMT+01:00 Doug Hutcheson :
> Hi everyone. I have been wrestling with the Eclipse IDE, but losing the
> fight. What do you use for development of Gambas code? (I am not referring
> to the Gambas Basic IDE here - I mean for developing Gambas itself). Thanks,
> Doug.
If i remember well I think Benoit use kate. :-) For my little little
time on coding C/C++ I use kate too because I don't need UI stuff.
>
>
> --------------------------------------------------
>
> This is the Gambas Mailing List
> https://lists.gambas-basic.org/listinfo/user
>
> Hosted by https://www.hostsharing.net
>
--
Fabien Bodard
From taboege at gmail.com Wed Jan 3 13:30:15 2018
From: taboege at gmail.com (Tobias Boege)
Date: Wed, 3 Jan 2018 13:30:15 +0100
Subject: [Gambas-user] What IDE if any to use for development of Gambas?
In-Reply-To:
References: <1514963016.4301.79.camel@gmail.com>
Message-ID: <20180103123015.GD21012@highrise.localdomain>
On Wed, 03 Jan 2018, Fabien Bodard wrote:
> 2018-01-03 8:03 GMT+01:00 Doug Hutcheson :
> > Hi everyone. I have been wrestling with the Eclipse IDE, but losing the
> > fight. What do you use for development of Gambas code? (I am not referring
> > to the Gambas Basic IDE here - I mean for developing Gambas itself). Thanks,
> > Doug.
>
> If i remember well I think Benoit use kate. :-) For my little little
> time on coding C/C++ I use kate too because I don't need UI stuff.
>
vim and ctags when I'm looking into the interpreter, vim and grep in
components. Everything grows smaller with some time, though, and you'll
learn where to expect what code.
Regards,
Tobi
--
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
From t.lee.davidson at gmail.com Wed Jan 3 18:14:39 2018
From: t.lee.davidson at gmail.com (T Lee Davidson)
Date: Wed, 3 Jan 2018 12:14:39 -0500
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To: <1514936520.4301.60.camel@gmail.com>
References: <1514684664.12546.82.camel@gmail.com>
<1514685624.12546.84.camel@gmail.com> <1514701561.12546.114.camel@gmail.com>
<8c776eb0-44f9-bf27-ddbf-a671ea9774d2@gmail.com>
<20171231201643.GB21012@highrise.localdomain>
<2263ed80-159d-a85b-ac73-fd5b5cae90af@gmail.com>
<1514787574.3338.6.camel@gmail.com> <1514792828.3338.25.camel@gmail.com>
<5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
<84aadabe-1831-c379-6611-82bf4dbd8c26@gmail.com>
<1514862032.3338.40.camel@gmail.com>
<1514867687.4301.5.camel@gmail.com> <1514870280.4301.14.camel@gmail.com>
<1514933764.4301.48.camel@gmail.com> <1514936520.4301.60.camel@gmail.com>
Message-ID:
On 01/02/2018 06:42 PM, Doug Hutcheson wrote:
> I can't imagine a case where one would #define 0, but I am willing to be proved wrong "8-)
For block commenting, with benefits?
> Is there a better way to collaborate than sending emails to the list? I'm sure other users must be getting sick of the constant
> flow of messages.
Messages can be kept off the list simply by replying to the sender instead of to the list. However, I was hoping someone else
(like Beno?t) would join in here, because you'd be further ahead collaborating with a fish than with me.
I was trying to help out and see if I could determine why the password property was not getting set in the connection object and
just happened to stumble across that one line that contained the error text I was getting. At one point when, in the signature
of DB_Open in gambas/main/lib/db/main.c, I saw "DB_DRIVER **driver" (which is, what, a pointer to a pointer?), I had gone as far
as my knowledge would take me.
If the database connection is defined programmatically, ie. not using a IDE-defined Connection, there is no problem connecting.
So, I think a password would indeed get sent if it was set, and the issue is, why is the connection object not being properly
populated from the IDE-defined Connection properties? Perhaps it is as you stated, "a pointer dereferencing issue with the
DB_DESC structure".
--
Lee
From g4mba5 at gmail.com Wed Jan 3 19:14:41 2018
From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=)
Date: Wed, 3 Jan 2018 19:14:41 +0100
Subject: [Gambas-user] What IDE if any to use for development of Gambas?
In-Reply-To: <20180103123015.GD21012@highrise.localdomain>
References: <1514963016.4301.79.camel@gmail.com>
<20180103123015.GD21012@highrise.localdomain>
Message-ID: <241ef3d9-322d-3225-f33f-a87b692b7b22@gmail.com>
Le 03/01/2018 ? 13:30, Tobias Boege a ?crit?:
> On Wed, 03 Jan 2018, Fabien Bodard wrote:
>> 2018-01-03 8:03 GMT+01:00 Doug Hutcheson :
>>> Hi everyone. I have been wrestling with the Eclipse IDE, but losing the
>>> fight. What do you use for development of Gambas code? (I am not referring
>>> to the Gambas Basic IDE here - I mean for developing Gambas itself). Thanks,
>>> Doug.
>>
>> If i remember well I think Benoit use kate. :-) For my little little
>> time on coding C/C++ I use kate too because I don't need UI stuff.
>>
>
> vim and ctags when I'm looking into the interpreter, vim and grep in
> components. Everything grows smaller with some time, though, and you'll
> learn where to expect what code.
>
> Regards,
> Tobi
>
I use Kate, or Geany when Kate starts to crash. If I have a text editor
with syntax highlighting, tabulation management, and a shortcut to
switch between the *.c file and the *.h file, I'm happy.
--
Beno?t Minisini
From g4mba5 at gmail.com Wed Jan 3 19:21:42 2018
From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=)
Date: Wed, 3 Jan 2018 19:21:42 +0100
Subject: [Gambas-user] Case problem in database fields
Message-ID: <8852b803-286c-94b7-6d3e-ad9e4ae27a6b@gmail.com>
Hi,
I have just come back from a trip, and didn't have the time to read all
the mails. By the way, I brought an influenza with me (that may be
malaria, I will make a blood test tomorrow), so it is a bit difficult to
concentrate...
I know that there is a problem with uppercase in database fields as soon
as you want to deal with different databases. If you use lowercase only,
you have no problem.
I will investigate that as soon as I am lucid enough.
Happy new year to everyone!
--
Beno?t Minisini
From taboege at gmail.com Wed Jan 3 20:13:03 2018
From: taboege at gmail.com (Tobias Boege)
Date: Wed, 3 Jan 2018 20:13:03 +0100
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To:
References: <5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
<84aadabe-1831-c379-6611-82bf4dbd8c26@gmail.com>
<1514862032.3338.40.camel@gmail.com>
<1514867687.4301.5.camel@gmail.com>
<1514870280.4301.14.camel@gmail.com>
<1514933764.4301.48.camel@gmail.com>
<1514936520.4301.60.camel@gmail.com>
Message-ID: <20180103191302.GF21012@highrise.localdomain>
On Wed, 03 Jan 2018, T Lee Davidson wrote:
> On 01/02/2018 06:42 PM, Doug Hutcheson wrote:
> > Is there a better way to collaborate than sending emails to the list? I'm sure other users must be getting sick of the constant
> > flow of messages.
>
> Messages can be kept off the list simply by replying to the sender instead of to the list. However, I was hoping someone else
> (like Beno?t) would join in here, because you'd be further ahead collaborating with a fish than with me.
>
We had a devel mailinglist when the lists were provided by sourceforge,
but it wasn't continued [1]. There is a #gambas channel on freenode,
if you want a chat. I've never heard of anyone using it but you might
recognise one or two.
> I was trying to help out and see if I could determine why the password property was not getting set in the connection object and
> just happened to stumble across that one line that contained the error text I was getting. At one point when, in the signature
> of DB_Open in gambas/main/lib/db/main.c, I saw "DB_DRIVER **driver" (which is, what, a pointer to a pointer?), I had gone as far
> as my knowledge would take me.
>
> If the database connection is defined programmatically, ie. not using a IDE-defined Connection, there is no problem connecting.
> So, I think a password would indeed get sent if it was set, and the issue is, why is the connection object not being properly
> populated from the IDE-defined Connection properties? Perhaps it is as you stated, "a pointer dereferencing issue with the
> DB_DESC structure".
>
This sounds more like a problem with the Connection editor in the IDE,
to me. I can't imagine a pointer dereferencing bug to only have such
gentle consequences.
I have never used the Connection editor, but from reading the code,
it doesn't save the password directly somewhere but uses Desktop.Passwords
to store and retrieve it, leaving the details to the current desktop's
tools. (I've never had much luck with gb.desktop as a whole, I must say,
and I don't know how it works.)
Also, I kind of lost the thread. We have two issues here, right?
1. The pg driver might not handle the case-insensitive column names
correctly in all places.
2. Opening IDE-defined connections with passwords fails.
Regards,
Tobi
[1] https://lists.gambas-basic.org/pipermail/user/2017-October/062196.html
--
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
From t.lee.davidson at gmail.com Wed Jan 3 22:18:22 2018
From: t.lee.davidson at gmail.com (T Lee Davidson)
Date: Wed, 3 Jan 2018 16:18:22 -0500
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To: <20180103191302.GF21012@highrise.localdomain>
References: <5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
<84aadabe-1831-c379-6611-82bf4dbd8c26@gmail.com>
<1514862032.3338.40.camel@gmail.com>
<1514867687.4301.5.camel@gmail.com> <1514870280.4301.14.camel@gmail.com>
<1514933764.4301.48.camel@gmail.com> <1514936520.4301.60.camel@gmail.com>
<20180103191302.GF21012@highrise.localdomain>
Message-ID:
On 01/03/2018 02:13 PM, Tobias Boege wrote:
>
> Also, I kind of lost the thread. We have two issues here, right?
>
> 1. The pg driver might not handle the case-insensitive column names
> correctly in all places.
> 2. Opening IDE-defined connections with passwords fails.
AFAIK, that is correct, Tobi.
> I have never used the Connection editor, but from reading the code,
> it doesn't save the password directly somewhere but uses Desktop.Passwords
> to store and retrieve it, leaving the details to the current desktop's
> tools. (I've never had much luck with gb.desktop as a whole, I must say,
> and I don't know how it works.)
I would have to agree that the problem is in the Connection editor, and more specifically, the manner in which it handles passwords.
As I reported earlier, when Saving the connection properties, I got an error, "Cannot store passwords on desktop KDE5: No wallet
found" even though "Remember password" was not enabled. That option seems to have no effect.
It is not an error that there was no wallet found. I don't use one. So, there should be a fall-back for that, IMO.
But even then, after I have entered the password and it is set in the editor's password field, the application is still unable
to connect.
--
Lee
From owlbrudder at gmail.com Wed Jan 3 23:59:40 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Thu, 04 Jan 2018 08:59:40 +1000
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To:
References: <1514684664.12546.82.camel@gmail.com>
<1514685624.12546.84.camel@gmail.com>
<1514701561.12546.114.camel@gmail.com>
<8c776eb0-44f9-bf27-ddbf-a671ea9774d2@gmail.com>
<20171231201643.GB21012@highrise.localdomain>
<2263ed80-159d-a85b-ac73-fd5b5cae90af@gmail.com>
<1514787574.3338.6.camel@gmail.com> <1514792828.3338.25.camel@gmail.com>
<5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
<84aadabe-1831-c379-6611-82bf4dbd8c26@gmail.com>
<1514862032.3338.40.camel@gmail.com>
<1514867687.4301.5.camel@gmail.com> <1514870280.4301.14.camel@gmail.com>
<1514933764.4301.48.camel@gmail.com> <1514936520.4301.60.camel@gmail.com>
Message-ID: <1515020380.4301.89.camel@gmail.com>
On Wed, 2018-01-03 at 12:14 -0500, T Lee Davidson wrote:
> On 01/02/2018 06:42 PM, Doug Hutcheson wrote:
> > I can't imagine a case where one would #define 0, but I am willing
> > to be proved wrong "8-)
>
> For block commenting, with benefits?
Hmmmm ... so that block could be activated by #define 0 - yes, I can
live with that. Thanks for the idea.
> > Is there a better way to collaborate than sending emails to the
> > list? I'm sure other users must be getting sick of the constant
> > flow of messages.
>
> Messages can be kept off the list simply by replying to the sender
> instead of to the list. However, I was hoping someone else
> (like Beno?t) would join in here, because you'd be further ahead
> collaborating with a fish than with me.
I would not presume to correspond directly unless invited to do so, but
I can see what you mean. Perhaps I should be like Trump and use
Twitter to communicate publicly?
Don't minimise your ability to contribute to the discussion - you have
been very helpful in confirming my problem is not just mine and in
prodding me to look further. I have started to get my head around the
code and am still at the steepest part of the learning curve, so I know
about as much as you at this stage.
> I was trying to help out and see if I could determine why the
> password property was not getting set in the connection object and
> just happened to stumble across that one line that contained the
> error text I was getting. At one point when, in the signature
> of DB_Open in gambas/main/lib/db/main.c, I saw "DB_DRIVER **driver"
> (which is, what, a pointer to a pointer?), I had gone as far
> as my knowledge would take me.
Yes, **thing is a double indirection to thing. I have browsed some of
the code and seen triple indirection ***thing used. Very useful and the
only solution in some cases.
> If the database connection is defined programmatically, ie. not using
> a IDE-defined Connection, there is no problem connecting.
> So, I think a password would indeed get sent if it was set, and the
> issue is, why is the connection object not being properly
> populated from the IDE-defined Connection properties? Perhaps it is
> as you stated, "a pointer dereferencing issue with the
> DB_DESC structure".
>
As you say, we can access the database through code, so the problem I
believe is going to be something simple in the end.
Kind regards, Doug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From owlbrudder at gmail.com Thu Jan 4 00:02:49 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Thu, 04 Jan 2018 09:02:49 +1000
Subject: [Gambas-user] Case problem in database fields
In-Reply-To: <8852b803-286c-94b7-6d3e-ad9e4ae27a6b@gmail.com>
References: <8852b803-286c-94b7-6d3e-ad9e4ae27a6b@gmail.com>
Message-ID: <1515020569.4301.92.camel@gmail.com>
On Wed, 2018-01-03 at 19:21 +0100, Beno?t Minisini wrote:
> Hi,
>
> I have just come back from a trip, and didn't have the time to read all
> the mails. By the way, I brought an influenza with me (that may be
> malaria, I will make a blood test tomorrow), so it is a bit difficult to
> concentrate...
>
> I know that there is a problem with uppercase in database fields as soon
> as you want to deal with different databases. If you use lowercase only,
> you have no problem.
>
> I will investigate that as soon as I am lucid enough.
>
> Happy new year to everyone!
>
I hope you get well soon, Beno?t. Please take time off to recover from
your physical bugs and don't worry about our software bugs. "8-)
When you are ready, I would be glad to help where I can.
Cheers, Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From owlbrudder at gmail.com Thu Jan 4 00:14:01 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Thu, 04 Jan 2018 09:14:01 +1000
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To: <20180103191302.GF21012@highrise.localdomain>
References: <5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
<84aadabe-1831-c379-6611-82bf4dbd8c26@gmail.com>
<1514862032.3338.40.camel@gmail.com>
<1514867687.4301.5.camel@gmail.com> <1514870280.4301.14.camel@gmail.com>
<1514933764.4301.48.camel@gmail.com> <1514936520.4301.60.camel@gmail.com>
<20180103191302.GF21012@highrise.localdomain>
Message-ID: <1515021241.4301.102.camel@gmail.com>
On Wed, 2018-01-03 at 20:13 +0100, Tobias Boege wrote:
> On Wed, 03 Jan 2018, T Lee Davidson wrote:
> > On 01/02/2018 06:42 PM, Doug Hutcheson wrote:
> > > Is there a better way to collaborate than sending emails to the
> > > list? I'm sure other users must be getting sick of the constant
> > > flow of messages.
> >
> > Messages can be kept off the list simply by replying to the sender
> > instead of to the list. However, I was hoping someone else
> > (like Beno?t) would join in here, because you'd be further ahead
> > collaborating with a fish than with me.
> >
>
> We had a devel mailinglist when the lists were provided by
> sourceforge,
> but it wasn't continued [1]. There is a #gambas channel on freenode,
> if you want a chat. I've never heard of anyone using it but you might
> recognise one or two.
>
> > I was trying to help out and see if I could determine why the
> > password property was not getting set in the connection object and
> > just happened to stumble across that one line that contained the
> > error text I was getting. At one point when, in the signature
> > of DB_Open in gambas/main/lib/db/main.c, I saw "DB_DRIVER **driver"
> > (which is, what, a pointer to a pointer?), I had gone as far
> > as my knowledge would take me.
> >
> > If the database connection is defined programmatically, ie. not
> > using a IDE-defined Connection, there is no problem connecting.
> > So, I think a password would indeed get sent if it was set, and the
> > issue is, why is the connection object not being properly
> > populated from the IDE-defined Connection properties? Perhaps it is
> > as you stated, "a pointer dereferencing issue with the
> > DB_DESC structure".
> >
>
> This sounds more like a problem with the Connection editor in the
> IDE,
> to me. I can't imagine a pointer dereferencing bug to only have such
> gentle consequences.
>
I agree, but it would make sense if the password was supposed to be
accessed via a pointer, but the pointer actually pointed to an area of
memory containing a null word at that moment. I suggested this as a
possibility only because I have seen that sort of behaviour in the
past. Like in my own code. Doh!
> I have never used the Connection editor,
So, how do you control your data-aware controls? Programmatically? I
could not see how to do that.
> but from reading the code,
> it doesn't save the password directly somewhere but uses
> Desktop.Passwords
> to store and retrieve it, leaving the details to the current
> desktop's
> tools. (I've never had much luck with gb.desktop as a whole, I must
> say,
> and I don't know how it works.)
Ah - the light dawns. If that is the case, it may require some kind of
setup for the password container on the desktop. More digging may shed
a light.
> Also, I kind of lost the thread. We have two issues here, right?
>
> 1. The pg driver might not handle the case-insensitive column names
> correctly in all places.
> 2. Opening IDE-defined connections with passwords fails.
Yes, exactly.
> Regards,
> Tobi
>
> [1] https://lists.gambas-basic.org/pipermail/user/2017-October/062196
> .html
>
Thanks for replying Tobi,
Cheers, Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From owlbrudder at gmail.com Thu Jan 4 00:29:42 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Thu, 04 Jan 2018 09:29:42 +1000
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To:
References: <5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
<84aadabe-1831-c379-6611-82bf4dbd8c26@gmail.com>
<1514862032.3338.40.camel@gmail.com>
<1514867687.4301.5.camel@gmail.com> <1514870280.4301.14.camel@gmail.com>
<1514933764.4301.48.camel@gmail.com> <1514936520.4301.60.camel@gmail.com>
<20180103191302.GF21012@highrise.localdomain>
Message-ID: <1515022182.4301.111.camel@gmail.com>
On Wed, 2018-01-03 at 16:18 -0500, T Lee Davidson wrote:
> On 01/03/2018 02:13 PM, Tobias Boege wrote:
> > Also, I kind of lost the thread. We have two issues here, right?
> >
> > 1. The pg driver might not handle the case-insensitive column
> > names
> > correctly in all places.
> > 2. Opening IDE-defined connections with passwords fails.
>
> AFAIK, that is correct, Tobi.
>
>
> > I have never used the Connection editor, but from reading the code,
> > it doesn't save the password directly somewhere but uses
> > Desktop.Passwords
> > to store and retrieve it, leaving the details to the current
> > desktop's
> > tools. (I've never had much luck with gb.desktop as a whole, I must
> > say,
> > and I don't know how it works.)
>
> I would have to agree that the problem is in the Connection editor,
> and more specifically, the manner in which it handles passwords.
>
> As I reported earlier, when Saving the connection properties, I got
> an error, "Cannot store passwords on desktop KDE5: No wallet
> found" even though "Remember password" was not enabled. That option
> seems to have no effect.
Just to add some information to that, I use the Gnome desktop, not KDE.
Gnome uses GnomeKeyring and, prompted by this discussion, I have just
browsed the keyring. It does have the correct password set for my
application PostgreSQL_test, using path
PostgreSQL_test/Connection/Connection1 - Connection1 being the
connection I have established for my test harness.
> It is not an error that there was no wallet found. I don't use one.
> So, there should be a fall-back for that, IMO.
>
> But even then, after I have entered the password and it is set in the
> editor's password field, the application is still unable
> to connect.
>
I agree. When I use the Connection editor, I can go back to it at any
time and find the password still correctly shown. Interesting.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From owlbrudder at gmail.com Thu Jan 4 00:40:14 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Thu, 04 Jan 2018 09:40:14 +1000
Subject: [Gambas-user] What IDE if any to use for development of Gambas?
In-Reply-To: <241ef3d9-322d-3225-f33f-a87b692b7b22@gmail.com>
References: <1514963016.4301.79.camel@gmail.com>
<20180103123015.GD21012@highrise.localdomain>
<241ef3d9-322d-3225-f33f-a87b692b7b22@gmail.com>
Message-ID: <1515022814.4301.119.camel@gmail.com>
On Wed, 2018-01-03 at 19:14 +0100, Beno?t Minisini wrote:
> Le 03/01/2018 ? 13:30, Tobias Boege a ?crit :
> > On Wed, 03 Jan 2018, Fabien Bodard wrote:
> > > 2018-01-03 8:03 GMT+01:00 Doug Hutcheson :
> > > > Hi everyone. I have been wrestling with the Eclipse IDE, but
> > > > losing the
> > > > fight. What do you use for development of Gambas code? (I am
> > > > not referring
> > > > to the Gambas Basic IDE here - I mean for developing Gambas
> > > > itself). Thanks,
> > > > Doug.
> > >
> > > If i remember well I think Benoit use kate. :-) For my little
> > > little
> > > time on coding C/C++ I use kate too because I don't need UI
> > > stuff.
> > >
> >
> > vim and ctags when I'm looking into the interpreter, vim and grep
> > in
> > components. Everything grows smaller with some time, though, and
> > you'll
> > learn where to expect what code.
> >
> > Regards,
> > Tobi
> >
>
> I use Kate, or Geany when Kate starts to crash. If I have a text
> editor
> with syntax highlighting, tabulation management, and a shortcut to
> switch between the *.c file and the *.h file, I'm happy.
>
Thank you all very much.
I am used to vi/vim and ctags, so will start there and see if I need
more 'help' from a GUI.
I'm sure Eclipse would be wonderful, if I could start by taking an
intensive six-week course in how to drive it. "8-D
When I was a software development team manager I could only dream of my
programmers writing such well structured code. As they say, it was like
herding cats.
Kind regards,
Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From t.lee.davidson at gmail.com Thu Jan 4 01:22:00 2018
From: t.lee.davidson at gmail.com (T Lee Davidson)
Date: Wed, 3 Jan 2018 19:22:00 -0500
Subject: [Gambas-user] IDE Connection Editor password save anamoly (was Re:
Extracting fields from a Result)
In-Reply-To: <1515022182.4301.111.camel@gmail.com>
References: <5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
<84aadabe-1831-c379-6611-82bf4dbd8c26@gmail.com>
<1514862032.3338.40.camel@gmail.com>
<1514867687.4301.5.camel@gmail.com> <1514870280.4301.14.camel@gmail.com>
<1514933764.4301.48.camel@gmail.com> <1514936520.4301.60.camel@gmail.com>
<20180103191302.GF21012@highrise.localdomain>
<1515022182.4301.111.camel@gmail.com>
Message-ID: <40176ba5-9e81-dc21-730f-a14a184db59c@gmail.com>
On 01/03/2018 06:29 PM, Doug Hutcheson wrote:
> Just to add some information to that, I use the Gnome desktop, not KDE. Gnome uses GnomeKeyring and, prompted by this
> discussion, I have just browsed the keyring. It does have the correct password set for my application PostgreSQL_test, using
> path PostgreSQL_test/Connection/Connection1 - Connection1 being the connection I have established for my test harness.
Given that, I would have to assume that the runtime is looking in the '.connection' Settings file in the project source
directory for the password. And, it's not there.
By looking at FNewConnection.class and MConnection.module in master/app/src/gambas3/.src/Connection, I see that, as Tobi pointed
out, the Connection Editor is relying solely on saving the password on the Desktop. It does not even attempt to save it in the
Settings file. That might be for security reasons.
But, if we have to put a password directly in code to make it successfully connect, what's the difference?
--
Lee
P.S. I've updated the subject line to more accurately describe the current context of this thread.
From owlbrudder at gmail.com Thu Jan 4 01:25:43 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Thu, 04 Jan 2018 10:25:43 +1000
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To: <1515022182.4301.111.camel@gmail.com>
References: <5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
<84aadabe-1831-c379-6611-82bf4dbd8c26@gmail.com>
<1514862032.3338.40.camel@gmail.com>
<1514867687.4301.5.camel@gmail.com> <1514870280.4301.14.camel@gmail.com>
<1514933764.4301.48.camel@gmail.com> <1514936520.4301.60.camel@gmail.com>
<20180103191302.GF21012@highrise.localdomain>
<1515022182.4301.111.camel@gmail.com>
Message-ID: <1515025543.4301.125.camel@gmail.com>
> > As I reported earlier, when Saving the connection properties, I got
> > an error, "Cannot store passwords on desktop KDE5: No wallet
> > found" even though "Remember password" was not enabled. That option
> > seems to have no effect.
>
> Just to add some information to that, I use the Gnome desktop, not
> KDE. Gnome uses GnomeKeyring and, prompted by this discussion, I have
> just browsed the keyring. It does have the correct password set for
> my application PostgreSQL_test, using path
> PostgreSQL_test/Connection/Connection1 - Connection1 being the
> connection I have established for my test harness.
Starting Gambas from the command line and trying to assess some data
resulted in this output on the terminal:
[doug at womble ~]$ gambas3
loaded the Generic plugin
** Message: Remote error from secret service:
org.freedesktop.DBus.Error.Failed: Couldn't create item: The secret was
transferred or encrypted in an invalid way.
So the spotlight is focusing on the way Gambas accesses the keyring.
That gives me something to go on. I will let you know if I find
anything.
> > It is not an error that there was no wallet found. I don't use one.
> > So, there should be a fall-back for that, IMO.
> >
> > But even then, after I have entered the password and it is set in
> > the editor's password field, the application is still unable
> > to connect.
> >
> I agree. When I use the Connection editor, I can go back to it at any
> time and find the password still correctly shown. Interesting.
I used Seahorse to browse my keyring. The second time I opened it, my
keys were gone. Backups are my friend, but I wonder what Seahorse did
to the keyring? Seahorse no longer has space on my system. Sigh.
Cheers, Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From owlbrudder at gmail.com Thu Jan 4 01:40:16 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Thu, 04 Jan 2018 10:40:16 +1000
Subject: [Gambas-user] IDE Connection Editor password save anomaly (was
Re: Extracting fields from a Result)
In-Reply-To: <40176ba5-9e81-dc21-730f-a14a184db59c@gmail.com>
References: <5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
<84aadabe-1831-c379-6611-82bf4dbd8c26@gmail.com>
<1514862032.3338.40.camel@gmail.com>
<1514867687.4301.5.camel@gmail.com> <1514870280.4301.14.camel@gmail.com>
<1514933764.4301.48.camel@gmail.com> <1514936520.4301.60.camel@gmail.com>
<20180103191302.GF21012@highrise.localdomain>
<1515022182.4301.111.camel@gmail.com>
<40176ba5-9e81-dc21-730f-a14a184db59c@gmail.com>
Message-ID: <1515026416.4301.131.camel@gmail.com>
On Wed, 2018-01-03 at 19:22 -0500, T Lee Davidson wrote:
> On 01/03/2018 06:29 PM, Doug Hutcheson wrote:
> > Just to add some information to that, I use the Gnome desktop, not
> > KDE. Gnome uses GnomeKeyring and, prompted by this
> > discussion, I have just browsed the keyring. It does have the
> > correct password set for my application PostgreSQL_test, using
> > path PostgreSQL_test/Connection/Connection1 - Connection1 being the
> > connection I have established for my test harness.
>
> Given that, I would have to assume that the runtime is looking in the
> '.connection' Settings file in the project source
> directory for the password. And, it's not there.
Perhaps it is sending an invalid request to secret-tool (the Gnome
variant). I have tried a couple of times to extract the key from the
command line using secret-tool and the result is a null value, exactly
what we are seeing when trying to make a connection. We may be onto
something here!
> By looking at FNewConnection.class and MConnection.module in
> master/app/src/gambas3/.src/Connection, I see that, as Tobi pointed
> out, the Connection Editor is relying solely on saving the password
> on the Desktop. It does not even attempt to save it in the
> Settings file. That might be for security reasons.
>
> But, if we have to put a password directly in code to make it
> successfully connect, what's the difference?
>
Exactly so.
Cheers, Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From t.lee.davidson at gmail.com Thu Jan 4 02:38:03 2018
From: t.lee.davidson at gmail.com (T Lee Davidson)
Date: Wed, 3 Jan 2018 20:38:03 -0500
Subject: [Gambas-user] IDE Connection Editor password save anomaly (was
Re: Extracting fields from a Result)
In-Reply-To: <1515026416.4301.131.camel@gmail.com>
References: <5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
<84aadabe-1831-c379-6611-82bf4dbd8c26@gmail.com>
<1514862032.3338.40.camel@gmail.com>
<1514867687.4301.5.camel@gmail.com> <1514870280.4301.14.camel@gmail.com>
<1514933764.4301.48.camel@gmail.com> <1514936520.4301.60.camel@gmail.com>
<20180103191302.GF21012@highrise.localdomain>
<1515022182.4301.111.camel@gmail.com>
<40176ba5-9e81-dc21-730f-a14a184db59c@gmail.com>
<1515026416.4301.131.camel@gmail.com>
Message-ID: <036fa7d0-e964-8158-4efd-e8f2cd49ea53@gmail.com>
On 01/03/2018 07:40 PM, Doug Hutcheson wrote:
>> Given that, I would have to assume that the runtime is looking in the '.connection' Settings file in the project source
>> directory for the password. And, it's not there.
>
> Perhaps it is sending an invalid request to secret-tool (the Gnome variant). I have tried a couple of times to extract the key
> from the command line using secret-tool and the result is a null value, exactly what we are seeing when trying to make a
> connection. We may be onto something here!
Doug, I'm not referring to a Desktop keyring. I'm referring to the Settings[0] file created by the Connection Editor when the
"OK" button is clicked. It is found in the project's directory in the hidden directory, ".connection". In my case, it is named,
"Connection1.connection" and is just a text file with the connection parameters -- minus the password.
--
Lee
[0]: http://gambaswiki.org/wiki/comp/gb.settings
From owlbrudder at gmail.com Thu Jan 4 02:52:56 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Thu, 04 Jan 2018 11:52:56 +1000
Subject: [Gambas-user] IDE Connection Editor password save anomaly (was
Re: Extracting fields from a Result)
In-Reply-To: <036fa7d0-e964-8158-4efd-e8f2cd49ea53@gmail.com>
References: <5c81a78a-e7b7-5cec-27a2-33152bf115d8@gmail.com>
<84aadabe-1831-c379-6611-82bf4dbd8c26@gmail.com>
<1514862032.3338.40.camel@gmail.com>
<1514867687.4301.5.camel@gmail.com> <1514870280.4301.14.camel@gmail.com>
<1514933764.4301.48.camel@gmail.com> <1514936520.4301.60.camel@gmail.com>
<20180103191302.GF21012@highrise.localdomain>
<1515022182.4301.111.camel@gmail.com>
<40176ba5-9e81-dc21-730f-a14a184db59c@gmail.com>
<1515026416.4301.131.camel@gmail.com>
<036fa7d0-e964-8158-4efd-e8f2cd49ea53@gmail.com>
Message-ID: <1515030776.4301.138.camel@gmail.com>
On Wed, 2018-01-03 at 20:38 -0500, T Lee Davidson wrote:
> On 01/03/2018 07:40 PM, Doug Hutcheson wrote:
> > > Given that, I would have to assume that the runtime is looking in
> > > the '.connection' Settings file in the project source
> > > directory for the password. And, it's not there.
> >
> > Perhaps it is sending an invalid request to secret-tool (the Gnome
> > variant). I have tried a couple of times to extract the key
> > from the command line using secret-tool and the result is a null
> > value, exactly what we are seeing when trying to make a
> > connection. We may be onto something here!
>
> Doug, I'm not referring to a Desktop keyring. I'm referring to the
> Settings[0] file created by the Connection Editor when the
> "OK" button is clicked. It is found in the project's directory in the
> hidden directory, ".connection". In my case, it is named,
> "Connection1.connection" and is just a text file with the connection
> parameters -- minus the password.
>
You are correct, Lee, the password is not being stored there. I was
leaping one step further and trying to decipher the alternative method
of using the keyring - sorry for the confusion. My few attempts to get
the password from the keyring were failures and I was just wondering if
a malformed request to the keyring is returning null. In the meantime,
I used Seahorse to browse my keyring and now it is not showing most of
my keys any more. Aaaargh! (Slaps forehead).
We will get to the bottom of this, but might need some help.
Kind regards,
Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From g4mba5 at gmail.com Thu Jan 4 08:29:03 2018
From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=)
Date: Thu, 4 Jan 2018 08:29:03 +0100
Subject: [Gambas-user] Password problem in database connection
Message-ID: <170f0de9-7e98-a338-eded-f1dcdd189e31@gmail.com>
Hi,
For information, the IDE use the 'gb.desktop' component for storing and
retrieving password.
The source code is in the "_Desktop_Password.class" file. That class
tries to use the command-line tool associated with the current desktop:
DBus with "KDE", secret-tool with "GNOME", "LXDE", "MATE", "XFCE",
"UNITY" and "CYGWIN".
Regards,
--
Beno?t Minisini
From owlbrudder at gmail.com Thu Jan 4 08:41:05 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Thu, 04 Jan 2018 17:41:05 +1000
Subject: [Gambas-user] Password problem in database connection
In-Reply-To: <170f0de9-7e98-a338-eded-f1dcdd189e31@gmail.com>
References: <170f0de9-7e98-a338-eded-f1dcdd189e31@gmail.com>
Message-ID: <1515051665.4409.9.camel@gmail.com>
On Thu, 2018-01-04 at 08:29 +0100, Beno?t Minisini wrote:
> Hi,
>
> For information, the IDE use the 'gb.desktop' component for storing and
> retrieving password.
>
> The source code is in the "_Desktop_Password.class" file. That class
> tries to use the command-line tool associated with the current desktop:
> DBus with "KDE", secret-tool with "GNOME", "LXDE", "MATE", "XFCE",
> "UNITY" and "CYGWIN".
>
> Regards,
>
Thanks Beno?t. I will have to bone up on secret-tool to see if I can
emulate what your code is doing, but from the command line. I am pretty
sure this is where the problem exists. Your code is corrctly setting
the password in the keyring, so it must be a problem with retrieving
the password again.
Kind regards,
Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From bugtracker at gambaswiki.org Thu Jan 4 11:51:28 2018
From: bugtracker at gambaswiki.org (bugtracker at gambaswiki.org)
Date: Thu, 04 Jan 2018 10:51:28 GMT
Subject: [Gambas-user] [Gambas Bug Tracker] Bug #1222: Circles on maps
In-Reply-To:
References:
Message-ID:
http://gambaswiki.org/bugtracker/edit?object=BUG.1222&from=L21haW4-
Comment #2 by Fabien BODARD:
Done in commit Commit f71115e8
https://gitlab.com/gambas/gambas/commit/f71115e89b0d0ac142467c5ca844251fe95aec85
With MapView1.Map["Poly"]
.AddCircle("pop", MapPoint(48.457454, -4.638139), 2000)
.Opacity = 1
End With
With MapView1.Map["Poly"]["pop"]
.FillColor = Color.SetAlpha(Color.Yellow, 50)
.Color = Color.Red
.LineWidth = 2
End With
Try it and report if you find bugs
Thank you
Fabien BODARD changed the state of the bug to: Accepted.
From t.lee.davidson at gmail.com Thu Jan 4 16:54:57 2018
From: t.lee.davidson at gmail.com (T Lee Davidson)
Date: Thu, 4 Jan 2018 10:54:57 -0500
Subject: [Gambas-user] The Impact of Meltdown & Spectre Vulnerabilities
Message-ID:
"Google?s Project Zero (GPZ) is a think tank of leading edge security researchers who have established a track record of ground
breaking research. Yesterday they announced a set of flaws in CPU architectures that create a two kinds of vulnerabilities.
It is early in the year, but this may be the most important and impactful security vulnerability in 2018. This affects any
software running on Intel chips, no matter the operating system or vendor. This affects every Intel processor since 1995 that
implements out-of-order execution, except Itanium, and the Atom before 2013.
The vulnerabilities were discovered by collaborating researchers at University of Pennsylvania, University of Maryland, Graz
University of Technology, Cyberus Technology, Rambus Cryptography Research Division, University of Adelaide and Data61 along
with researchers at GPZ."
[https://www.defiant.com/meltdown-spectre-impact/]
--
Lee
From bugtracker at gambaswiki.org Thu Jan 4 17:19:43 2018
From: bugtracker at gambaswiki.org (bugtracker at gambaswiki.org)
Date: Thu, 04 Jan 2018 16:19:43 GMT
Subject: [Gambas-user] [Gambas Bug Tracker] Bug #1222: Circles on maps
In-Reply-To:
References:
Message-ID:
http://gambaswiki.org/bugtracker/edit?object=BUG.1222&from=L21haW4-
Comment #3 by Carlo PANARA:
OK Thank you!
From mckaygerhard at gmail.com Thu Jan 4 19:37:47 2018
From: mckaygerhard at gmail.com (PICCORO McKAY Lenz)
Date: Thu, 4 Jan 2018 14:37:47 -0400
Subject: [Gambas-user] The Impact of Meltdown & Spectre Vulnerabilities
In-Reply-To:
References:
Message-ID:
i a great vulnerability, now people of IT must thnkg that always "grow up"
without taking care are a pain in the future..
Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com
2018-01-04 11:54 GMT-04:00 T Lee Davidson :
> "Google?s Project Zero (GPZ) is a think tank of leading edge security
> researchers who have established a track record of ground
> breaking research. Yesterday they announced a set of flaws in CPU
> architectures that create a two kinds of vulnerabilities.
>
> It is early in the year, but this may be the most important and impactful
> security vulnerability in 2018. This affects any
> software running on Intel chips, no matter the operating system or vendor.
> This affects every Intel processor since 1995 that
> implements out-of-order execution, except Itanium, and the Atom before
> 2013.
>
> The vulnerabilities were discovered by collaborating researchers at
> University of Pennsylvania, University of Maryland, Graz
> University of Technology, Cyberus Technology, Rambus Cryptography Research
> Division, University of Adelaide and Data61 along
> with researchers at GPZ."
>
> [https://www.defiant.com/meltdown-spectre-impact/]
>
>
> --
> Lee
>
> --------------------------------------------------
>
> This is the Gambas Mailing List
> https://lists.gambas-basic.org/listinfo/user
>
> Hosted by https://www.hostsharing.net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From mckaygerhard at gmail.com Thu Jan 4 19:43:45 2018
From: mckaygerhard at gmail.com (PICCORO McKAY Lenz)
Date: Thu, 4 Jan 2018 14:43:45 -0400
Subject: [Gambas-user] The Impact of Meltdown & Spectre Vulnerabilities
In-Reply-To:
References:
Message-ID:
ah i forgot to mention! my K6-III and my older atom mini lapto are not
sufering from those two problems..
the problem afects a specific series or procesors, as T said, older before
1995 (suck my K6-III) and atoms before 2013 are not affected..
It is a great example that the excessive evolution leads to hidden errors
that are paid in the future, everyone knows that I am a detractor of
evolution so quickly, because we know that everything must be controlled
and made discreet ..
For example, Apple has removed the 3.5 mm jack forever, now you can only
use wireless headphones. If this had been done 10 years ago, the only
problem would not have been the costs.
Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com
2018-01-04 14:37 GMT-04:00 PICCORO McKAY Lenz :
> i a great vulnerability, now people of IT must thnkg that always "grow up"
> without taking care are a pain in the future..
>
> Lenz McKAY Gerardo (PICCORO)
> http://qgqlochekone.blogspot.com
>
> 2018-01-04 11:54 GMT-04:00 T Lee Davidson :
>
>> "Google?s Project Zero (GPZ) is a think tank of leading edge security
>> researchers who have established a track record of ground
>> breaking research. Yesterday they announced a set of flaws in CPU
>> architectures that create a two kinds of vulnerabilities.
>>
>> It is early in the year, but this may be the most important and impactful
>> security vulnerability in 2018. This affects any
>> software running on Intel chips, no matter the operating system or
>> vendor. This affects every Intel processor since 1995 that
>> implements out-of-order execution, except Itanium, and the Atom before
>> 2013.
>>
>> The vulnerabilities were discovered by collaborating researchers at
>> University of Pennsylvania, University of Maryland, Graz
>> University of Technology, Cyberus Technology, Rambus Cryptography
>> Research Division, University of Adelaide and Data61 along
>> with researchers at GPZ."
>>
>> [https://www.defiant.com/meltdown-spectre-impact/]
>>
>>
>> --
>> Lee
>>
>> --------------------------------------------------
>>
>> This is the Gambas Mailing List
>> https://lists.gambas-basic.org/listinfo/user
>>
>> Hosted by https://www.hostsharing.net
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From mckaygerhard at gmail.com Thu Jan 4 20:15:21 2018
From: mckaygerhard at gmail.com (PICCORO McKAY Lenz)
Date: Thu, 4 Jan 2018 15:15:21 -0400
Subject: [Gambas-user] Password problem in database connection
In-Reply-To: <1515051665.4409.9.camel@gmail.com>
References: <170f0de9-7e98-a338-eded-f1dcdd189e31@gmail.com>
<1515051665.4409.9.camel@gmail.com>
Message-ID:
a fool question, if i not have any of those stuff can i still use if i do
not decided to store the password? similar problem happened in the pas when
gnome-keyring was not available..
Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com
2018-01-04 3:41 GMT-04:00 Doug Hutcheson :
> On Thu, 2018-01-04 at 08:29 +0100, Beno?t Minisini wrote:
>
> Hi,
>
> For information, the IDE use the 'gb.desktop' component for storing and
> retrieving password.
>
> The source code is in the "_Desktop_Password.class" file. That class
> tries to use the command-line tool associated with the current desktop:
> DBus with "KDE", secret-tool with "GNOME", "LXDE", "MATE", "XFCE",
> "UNITY" and "CYGWIN".
>
> Regards,
>
>
> Thanks Beno?t. I will have to bone up on secret-tool to see if I can
> emulate what your code is doing, but from the command line. I am pretty
> sure this is where the problem exists. Your code is corrctly setting the
> password in the keyring, so it must be a problem with retrieving the
> password again.
>
> Kind regards,
> Doug
>
>
> --------------------------------------------------
>
> This is the Gambas Mailing List
> https://lists.gambas-basic.org/listinfo/user
>
> Hosted by https://www.hostsharing.net
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From mckaygerhard at gmail.com Thu Jan 4 20:16:48 2018
From: mckaygerhard at gmail.com (PICCORO McKAY Lenz)
Date: Thu, 4 Jan 2018 15:16:48 -0400
Subject: [Gambas-user] What IDE if any to use for development of Gambas?
In-Reply-To: <1515022814.4301.119.camel@gmail.com>
References: <1514963016.4301.79.camel@gmail.com>
<20180103123015.GD21012@highrise.localdomain>
<241ef3d9-322d-3225-f33f-a87b692b7b22@gmail.com>
<1515022814.4301.119.camel@gmail.com>
Message-ID:
ahhh geany rules!
Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com
2018-01-03 19:40 GMT-04:00 Doug Hutcheson :
>
>
> On Wed, 2018-01-03 at 19:14 +0100, Beno?t Minisini wrote:
>
> Le 03/01/2018 ? 13:30, Tobias Boege a ?crit :
>
>
> On Wed, 03 Jan 2018, Fabien Bodard wrote:
>
>
> 2018-01-03 8:03 GMT+01:00 Doug Hutcheson :
>
>
> Hi everyone. I have been wrestling with the Eclipse IDE, but losing the
> fight. What do you use for development of Gambas code? (I am not referring
> to the Gambas Basic IDE here - I mean for developing Gambas itself). Thanks,
> Doug.
>
>
>
> If i remember well I think Benoit use kate. :-) For my little little
> time on coding C/C++ I use kate too because I don't need UI stuff.
>
>
>
>
> vim and ctags when I'm looking into the interpreter, vim and grep in
> components. Everything grows smaller with some time, though, and you'll
> learn where to expect what code.
>
> Regards,
> Tobi
>
>
>
>
> I use Kate, or Geany when Kate starts to crash. If I have a text editor
> with syntax highlighting, tabulation management, and a shortcut to
> switch between the *.c file and the *.h file, I'm happy.
>
>
>
> Thank you all very much.
>
> I am used to vi/vim and ctags, so will start there and see if I need more
> 'help' from a GUI.
> I'm sure Eclipse would be wonderful, if I could start by taking an
> intensive six-week course in how to drive it. "8-D
>
> When I was a software development team manager I could only dream of my
> programmers writing such well structured code. As they say, it was like
> herding cats.
>
> Kind regards,
> Doug
>
>
> --------------------------------------------------
>
> This is the Gambas Mailing List
> https://lists.gambas-basic.org/listinfo/user
>
> Hosted by https://www.hostsharing.net
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From karl.reinl at fen-net.de Thu Jan 4 20:56:29 2018
From: karl.reinl at fen-net.de (Karl Reinl)
Date: Thu, 04 Jan 2018 20:56:29 +0100
Subject: [Gambas-user] What IDE if any to use for development of Gambas?
In-Reply-To: <1515022814.4301.119.camel@gmail.com>
References: <1514963016.4301.79.camel@gmail.com>
<20180103123015.GD21012@highrise.localdomain>
<241ef3d9-322d-3225-f33f-a87b692b7b22@gmail.com>
<1515022814.4301.119.camel@gmail.com>
Message-ID: <1515095789.10085.4.camel@Scenic.local>
Am Donnerstag, den 04.01.2018, 09:40 +1000 schrieb Doug Hutcheson:
>
>
>
>
> On Wed, 2018-01-03 at 19:14 +0100, Beno?t Minisini wrote:
> > Le 03/01/2018 ? 13:30, Tobias Boege a ?crit :
> > >
> > > On Wed, 03 Jan 2018, Fabien Bodard wrote:
> > > >
> > > > 2018-01-03 8:03 GMT+01:00 Doug Hutcheson :
> > > > >
> > > > > Hi everyone. I have been wrestling with the Eclipse IDE, but losing the
> > > > > fight. What do you use for development of Gambas code? (I am not referring
> > > > > to the Gambas Basic IDE here - I mean for developing Gambas itself). Thanks,
> > > > > Doug.
> > > >
> > > >
> > > > If i remember well I think Benoit use kate. :-) For my little little
> > > > time on coding C/C++ I use kate too because I don't need UI stuff.
> > > >
> > >
> > >
> > > vim and ctags when I'm looking into the interpreter, vim and grep in
> > > components. Everything grows smaller with some time, though, and you'll
> > > learn where to expect what code.
> > >
> > > Regards,
> > > Tobi
> > >
> >
> >
> > I use Kate, or Geany when Kate starts to crash. If I have a text editor
> > with syntax highlighting, tabulation management, and a shortcut to
> > switch between the *.c file and the *.h file, I'm happy.
> >
>
>
> Thank you all very much.
>
>
> I am used to vi/vim and ctags, so will start there and see if I need
> more 'help' from a GUI.
> I'm sure Eclipse would be wonderful, if I could start by taking an
> intensive six-week course in how to drive it. "8-D
>
>
> When I was a software development team manager I could only dream of
> my programmers writing such well structured code. As they say, it was
> like herding cats.
>
Salut Doug,
once (in march 2005) I wrote down what I did to use Eclipse on the (at
that time gambas1) source code.
I don't if that way work still today, but can be a starter.
--
Amicalement
Charlie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: useEclipse.pdf
Type: application/pdf
Size: 325451 bytes
Desc: not available
URL:
From mb at code-it.com Thu Jan 4 22:41:05 2018
From: mb at code-it.com (mikeB)
Date: Thu, 4 Jan 2018 14:41:05 -0700
Subject: [Gambas-user] Web Cam preview and capture
Message-ID: <43ffc9f8-9079-1e61-e619-5579b1102ed9@code-it.com>
eGreetings Gambas World,
Would anyone out there happen to have a code snippet or simple
Gambas project that reviews/ displays the web cam input and records
video with sound - that you're willing to share?
I know how to record using ffmpeg but can not find a way to review/
display what it's recording. Also, have spent days looking at the code
of "MediaPlayer" from the Gambas farm - it's completely above my head
;-(
A BIG THANKS for your consideration,
mikeB
From owlbrudder at gmail.com Fri Jan 5 00:14:42 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Fri, 05 Jan 2018 09:14:42 +1000
Subject: [Gambas-user] What IDE if any to use for development of Gambas?
In-Reply-To: <1515095789.10085.4.camel@Scenic.local>
References: <1514963016.4301.79.camel@gmail.com>
<20180103123015.GD21012@highrise.localdomain>
<241ef3d9-322d-3225-f33f-a87b692b7b22@gmail.com>
<1515022814.4301.119.camel@gmail.com>
<1515095789.10085.4.camel@Scenic.local>
Message-ID: <1515107682.4277.2.camel@gmail.com>
> Salut Doug,
>
> once (in march 2005) I wrote down what I did to use Eclipse on the (at
> that time gambas1) source code.
> I don't if that way work still today, but can be a starter.
>
Salut Charlie.
Those instructions are great and I am sure I can apply them to the
latest version of Eclipse. I will study the instruction with Eclipse
open and see what I can do.
Many thanks,
Doug
From owlbrudder at gmail.com Fri Jan 5 00:26:57 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Fri, 05 Jan 2018 09:26:57 +1000
Subject: [Gambas-user] Password problem in database connection
In-Reply-To:
References: <170f0de9-7e98-a338-eded-f1dcdd189e31@gmail.com>
<1515051665.4409.9.camel@gmail.com>
Message-ID: <1515108417.4277.11.camel@gmail.com>
On Thu, 2018-01-04 at 15:15 -0400, PICCORO McKAY Lenz wrote:
> a fool question, if i not have any of those stuff can i still use if
> i do not decided to store the password? similar problem happened in
> the pas when gnome-keyring was not available..
>
> Lenz McKAY Gerardo (PICCORO)
> http://qgqlochekone.blogspot.com
>
> 2018-01-04 3:41 GMT-04:00 Doug Hutcheson :
> > On Thu, 2018-01-04 at 08:29 +0100, Beno?t Minisini wrote:
> > > Hi,
> > >
> > > For information, the IDE use the 'gb.desktop' component for
> > > storing and
> > > retrieving password.
> > >
> > > The source code is in the "_Desktop_Password.class" file. That
> > > class
> > > tries to use the command-line tool associated with the current
> > > desktop:
> > > DBus with "KDE", secret-tool with "GNOME", "LXDE", "MATE",
> > > "XFCE",
> > > "UNITY" and "CYGWIN".
> > >
> > > Regards,
> > >
> >
> > Thanks Beno?t. I will have to bone up on secret-tool to see if I
> > can emulate what your code is doing, but from the command line. I
> > am pretty sure this is where the problem exists. Your code is
> > corrctly setting the password in the keyring, so it must be a
> > problem with retrieving the password again.
> >
> > Kind regards,
> > Doug
> >
> >
PICCORO, you can still access a database through code with the password
'hard wired', but I do not see how you could use the Connection objects
without a desktop keyring. I may be wrong - I often am. "8-)
From taboege at gmail.com Fri Jan 5 01:08:26 2018
From: taboege at gmail.com (Tobias Boege)
Date: Fri, 5 Jan 2018 01:08:26 +0100
Subject: [Gambas-user] Password problem in database connection
In-Reply-To: <1515108417.4277.11.camel@gmail.com>
References: <170f0de9-7e98-a338-eded-f1dcdd189e31@gmail.com>
<1515051665.4409.9.camel@gmail.com>
<1515108417.4277.11.camel@gmail.com>
Message-ID: <20180105000826.GA1055@highrise.localdomain>
On Fri, 05 Jan 2018, Doug Hutcheson wrote:
> On Thu, 2018-01-04 at 15:15 -0400, PICCORO McKAY Lenz wrote:
> > a fool question, if i not have any of those stuff can i still use if
> > i do not decided to store the password? similar problem happened in
> > the pas when gnome-keyring was not available..
> >
> > Lenz McKAY Gerardo (PICCORO)
> > http://qgqlochekone.blogspot.com
> >
> > 2018-01-04 3:41 GMT-04:00 Doug Hutcheson :
> > > On Thu, 2018-01-04 at 08:29 +0100, Beno?t Minisini wrote:
> > > > Hi,
> > > >
> > > > For information, the IDE use the 'gb.desktop' component for
> > > > storing and
> > > > retrieving password.
> > > >
> > > > The source code is in the "_Desktop_Password.class" file. That
> > > > class
> > > > tries to use the command-line tool associated with the current
> > > > desktop:
> > > > DBus with "KDE", secret-tool with "GNOME", "LXDE", "MATE",
> > > > "XFCE",
> > > > "UNITY" and "CYGWIN".
> > > >
> > > > Regards,
> > > >
> > >
> > > Thanks Beno?t. I will have to bone up on secret-tool to see if I
> > > can emulate what your code is doing, but from the command line. I
> > > am pretty sure this is where the problem exists. Your code is
> > > corrctly setting the password in the keyring, so it must be a
> > > problem with retrieving the password again.
> > >
> > > Kind regards,
> > > Doug
> > >
> > >
>
> PICCORO, you can still access a database through code with the password
> 'hard wired', but I do not see how you could use the Connection objects
> without a desktop keyring. I may be wrong - I often am. "8-)
>
You are, unless you are all implicitly talking about the IDE-built-in
Connection features only. I have never used the IDE to manage my
Connections and I don't use my desktop's keyring.
What I do is effectively the same as what the IDE does though: create
a Connection object programmatically and configure it from a Settings
file, except that my file is in the application's configuration
directory (where it belongs, IMHO), and not in the source code directory.
As for the passwords, I've seen a number of programs (maybe I'm only
looking at very old PHP/perl scripts?) which simply save database
passwords in plain text. That's an option. You can also halt the
execution when your program initialises and ask for the password once.
The way I go by default is a password-less login using MariaDB's
auth_socket [1], which requires the application to be on the same
server as the database(!). You connect through a local UNIX socket,
which allows the database server to determine your system account.
By logging in and starting the program as the right system user,
you prove that you are entitled to certain rights in the database,
too, but you keep the password business out of the database layer.
(Of course, by changing the configuration file, the person installing
the software can choose to use a simple SQLite db as well or a password
saved in plain text, provided that the program was made DBMS-agnostic
enough. All this choice is built into the Connection object already
and it should be used, and provided to the person who has to deal with
the program in the end. )
Regards,
Tobi
[1] https://mariadb.com/kb/en/library/authentication-plugin-unix-socket/
--
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
From owlbrudder at gmail.com Fri Jan 5 01:22:09 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Fri, 05 Jan 2018 10:22:09 +1000
Subject: [Gambas-user] Password problem in database connection
In-Reply-To: <20180105000826.GA1055@highrise.localdomain>
References: <170f0de9-7e98-a338-eded-f1dcdd189e31@gmail.com>
<1515051665.4409.9.camel@gmail.com>
<1515108417.4277.11.camel@gmail.com>
<20180105000826.GA1055@highrise.localdomain>
Message-ID: <1515111729.4277.19.camel@gmail.com>
On Fri, 2018-01-05 at 01:08 +0100, Tobias Boege wrote:
> On Fri, 05 Jan 2018, Doug Hutcheson wrote:
> > On Thu, 2018-01-04 at 15:15 -0400, PICCORO McKAY Lenz wrote:
> > > a fool question, if i not have any of those stuff can i still use
> > > if
> > > i do not decided to store the password? similar problem happened
> > > in
> > > the pas when gnome-keyring was not available..
> > >
> > > Lenz McKAY Gerardo (PICCORO)
> > > http://qgqlochekone.blogspot.com
> > >
> > > 2018-01-04 3:41 GMT-04:00 Doug Hutcheson :
> > > > On Thu, 2018-01-04 at 08:29 +0100, Beno?t Minisini wrote:
> > > > > Hi,
> > > > >
> > > > > For information, the IDE use the 'gb.desktop' component for
> > > > > storing and
> > > > > retrieving password.
> > > > >
> > > > > The source code is in the "_Desktop_Password.class" file.
> > > > > That
> > > > > class
> > > > > tries to use the command-line tool associated with the
> > > > > current
> > > > > desktop:
> > > > > DBus with "KDE", secret-tool with "GNOME", "LXDE", "MATE",
> > > > > "XFCE",
> > > > > "UNITY" and "CYGWIN".
> > > > >
> > > > > Regards,
> > > > >
> > > >
> > > > Thanks Beno?t. I will have to bone up on secret-tool to see if
> > > > I
> > > > can emulate what your code is doing, but from the command line.
> > > > I
> > > > am pretty sure this is where the problem exists. Your code is
> > > > corrctly setting the password in the keyring, so it must be a
> > > > problem with retrieving the password again.
> > > >
> > > > Kind regards,
> > > > Doug
> > > >
> > > >
> >
> > PICCORO, you can still access a database through code with the
> > password
> > 'hard wired', but I do not see how you could use the Connection
> > objects
> > without a desktop keyring. I may be wrong - I often am. "8-)
> >
>
> You are, unless you are all implicitly talking about the IDE-built-in
> Connection features only. I have never used the IDE to manage my
> Connections and I don't use my desktop's keyring.
>
> What I do is effectively the same as what the IDE does though: create
> a Connection object programmatically and configure it from a Settings
> file, except that my file is in the application's configuration
> directory (where it belongs, IMHO), and not in the source code
> directory.
>
> As for the passwords, I've seen a number of programs (maybe I'm only
> looking at very old PHP/perl scripts?) which simply save database
> passwords in plain text. That's an option. You can also halt the
> execution when your program initialises and ask for the password
> once.
>
> The way I go by default is a password-less login using MariaDB's
> auth_socket [1], which requires the application to be on the same
> server as the database(!). You connect through a local UNIX socket,
> which allows the database server to determine your system account.
> By logging in and starting the program as the right system user,
> you prove that you are entitled to certain rights in the database,
> too, but you keep the password business out of the database layer.
>
> (Of course, by changing the configuration file, the person installing
> the software can choose to use a simple SQLite db as well or a
> password
> saved in plain text, provided that the program was made DBMS-agnostic
> enough. All this choice is built into the Connection object already
> and it should be used, and provided to the person who has to deal
> with
> the program in the end. )
>
> Regards,
> Tobi
>
> [1] https://mariadb.com/kb/en/library/authentication-plugin-unix-sock
> et/
>
>
That is sound advice, Tobi. I was expecting to be able to use the IDE
Connection tool because it was there and I assumed it was the correct
way to go. "8-)
I will now examine the Connection object and see if it allows me to use
it for data-aware controls - I assume it does.
Many thanks for your input.
Kind regards,
Doug
From taboege at gmail.com Fri Jan 5 01:50:58 2018
From: taboege at gmail.com (Tobias Boege)
Date: Fri, 5 Jan 2018 01:50:58 +0100
Subject: [Gambas-user] Password problem in database connection
In-Reply-To: <1515111729.4277.19.camel@gmail.com>
References: <170f0de9-7e98-a338-eded-f1dcdd189e31@gmail.com>
<1515051665.4409.9.camel@gmail.com>
<1515108417.4277.11.camel@gmail.com>
<20180105000826.GA1055@highrise.localdomain>
<1515111729.4277.19.camel@gmail.com>
Message-ID: <20180105005057.GB1055@highrise.localdomain>
On Fri, 05 Jan 2018, Doug Hutcheson wrote:
> That is sound advice, Tobi. I was expecting to be able to use the IDE
> Connection tool because it was there and I assumed it was the correct
> way to go. "8-)
>
> I will now examine the Connection object and see if it allows me to use
> it for data-aware controls - I assume it does.
>
Ah, I think I understand your recent and current concerns about the
data-aware/-bound controls now.
These controls work when you place them inside a DataSource container
and the DataSource needs a Connection object in its property of the
same name. True to its name, the DataSource container provides its
children with (meta)data from the database and it needs a Connection
to a database to do that. Makes sense, right?
The IDE form editor of course lets you only select Connections it knows
about, in that little Combobox. Since you create the Connection at
runtime now, let it be inside a variable $hConn, you need to set
DataSource1.Connection = $hConn
at some point in your code and everything will work. Where this line
occurs depends on your program (do you have the Connection ready before
the form containing the data-aware controls is shown or do you establish
it on-demand?).
Note that (IIRC) you can fill/change the DataSource.Connection at any
time, so whatever you do should be fine.
I didn't get your problem when you mentioned data-aware controls the
first time because I don't use the form editor all that often anymore,
and as you see, data-aware controls aren't really related otherwise
to defining Connections.
Regards,
Tobi
--
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
From owlbrudder at gmail.com Fri Jan 5 02:05:19 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Fri, 05 Jan 2018 11:05:19 +1000
Subject: [Gambas-user] Password problem in database connection
In-Reply-To: <20180105005057.GB1055@highrise.localdomain>
References: <170f0de9-7e98-a338-eded-f1dcdd189e31@gmail.com>
<1515051665.4409.9.camel@gmail.com>
<1515108417.4277.11.camel@gmail.com>
<20180105000826.GA1055@highrise.localdomain>
<1515111729.4277.19.camel@gmail.com>
<20180105005057.GB1055@highrise.localdomain>
Message-ID: <1515114319.4277.29.camel@gmail.com>
On Fri, 2018-01-05 at 01:50 +0100, Tobias Boege wrote:
> On Fri, 05 Jan 2018, Doug Hutcheson wrote:
> > That is sound advice, Tobi. I was expecting to be able to use the
> > IDE
> > Connection tool because it was there and I assumed it was the
> > correct
> > way to go. "8-)
> >
> > I will now examine the Connection object and see if it allows me to
> > use
> > it for data-aware controls - I assume it does.
> >
>
> Ah, I think I understand your recent and current concerns about the
> data-aware/-bound controls now.
>
> These controls work when you place them inside a DataSource container
> and the DataSource needs a Connection object in its property of the
> same name. True to its name, the DataSource container provides its
> children with (meta)data from the database and it needs a Connection
> to a database to do that. Makes sense, right?
>
> The IDE form editor of course lets you only select Connections it
> knows
> about, in that little Combobox. Since you create the Connection at
> runtime now, let it be inside a variable $hConn, you need to set
>
> DataSource1.Connection = $hConn
>
> at some point in your code and everything will work. Where this line
> occurs depends on your program (do you have the Connection ready
> before
> the form containing the data-aware controls is shown or do you
> establish
> it on-demand?).
>
> Note that (IIRC) you can fill/change the DataSource.Connection at any
> time, so whatever you do should be fine.
>
> I didn't get your problem when you mentioned data-aware controls the
> first time because I don't use the form editor all that often
> anymore,
> and as you see, data-aware controls aren't really related otherwise
> to defining Connections.
>
> Regards,
> Tobi
>
Thanks a million Tobi - you have saved me many hours of wandering
through the maze of code.
Using a programmatic connection object will be fine.
The IDE still has the disadvantage that one cannot create and test a
Connection conveniently, but I will forgive that now that I know the alternative.
Still, it would be nice if it worked ... "8-)
Kind regards,
Doug.
From bagonergi at gmail.com Fri Jan 5 09:32:05 2018
From: bagonergi at gmail.com (Gianluigi)
Date: Fri, 5 Jan 2018 09:32:05 +0100
Subject: [Gambas-user] Web Cam preview and capture
In-Reply-To: <43ffc9f8-9079-1e61-e619-5579b1102ed9@code-it.com>
References: <43ffc9f8-9079-1e61-e619-5579b1102ed9@code-it.com>
Message-ID:
I do not know if these lessons can help you:
http://www.gambas-it.org/wiki/index.php?title=Effettuare_una_ripresa_video_mediante_una_WebCam_con_il_Componente_gb.media
http://www.gambas-it.org/wiki/index.php?title=Salvare_in_un_file_OGV_una_ripresa_video_mediante_una_WebCam_con_il_Componente_gb.media
http://www.gambas-it.org/wiki/index.php?title=Salvare_in_un_file_MKV_una_ripresa_video_mediante_una_WebCam_con_il_Componente_gb.media
http://www.gambas-it.org/wiki/index.php?title=Catturare_video_e_audio_con_una_webcam_ed_un_microfono_e_salvarli_in_un_unico_file_video_mediante_le_funzioni_esterne_del_API_di_VLC
http://www.gambas-it.org/wiki/index.php?title=Catturare_e_riprodurre_immagini_video_mediante_una_WebCam_con_le_funzioni_esterne_delle_API_di_GStreamer
http://www.gambas-it.org/wiki/index.php?title=Salvare_in_un_file_video_mediante_le_funzioni_esterne_del_API_di_GStreamer_la_ripresa_video_effettuata_con_una_WebCam
http://www.gambas-it.org/wiki/index.php?title=Catturare_e_riprodurre_immagini_video_mediante_una_WebCam_con_le_funzioni_esterne_delle_API_di_VLC
Regards
Gianluigi
2018-01-04 22:41 GMT+01:00 mikeB :
> eGreetings Gambas World,
>
> Would anyone out there happen to have a code snippet or simple
> Gambas project that reviews/ displays the web cam input and records
> video with sound - that you're willing to share?
>
> I know how to record using ffmpeg but can not find a way to review/
> display what it's recording. Also, have spent days looking at the code
> of "MediaPlayer" from the Gambas farm - it's completely above my head
> ;-(
>
> A BIG THANKS for your consideration,
> mikeB
>
> --------------------------------------------------
>
> This is the Gambas Mailing List
> https://lists.gambas-basic.org/listinfo/user
>
> Hosted by https://www.hostsharing.net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From g4mba5 at gmail.com Fri Jan 5 14:23:31 2018
From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=)
Date: Fri, 5 Jan 2018 14:23:31 +0100
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To: <1514684664.12546.82.camel@gmail.com>
References: <1514684664.12546.82.camel@gmail.com>
Message-ID: <682dfc0f-136a-f7c7-8b0c-d32043a6e939@gmail.com>
Le 31/12/2017 ? 02:44, Doug Hutcheson a ?crit?:
> Hi everyone.
>
> I have successfully connected to my PostgreSQL database and the field
> count in the Result from my query is correct, but all my attempts to
> extract data from the fields have failed. I am cobbling together code
> from the wiki and from other posts here, but I am still missing something.
>
> The table I am reading from has exactly one row and 35 fields. The first
> field is named txtMasterDatabase.
>
> My code declares a Field and a Result as follows:
> ??????????Dim $Field As ResultField
> ??????????Dim $Result As Result
>
> The query works correctly:
> ???????????$Query = "Select * From abpa.tblParameters"
> ???????????$Result = $Con.Exec($Query)
>
> The field count is correct - 35:
> ???????????Message("Fields count = " & $Result.Fields.Count)
>
> Now I try to loop through the fields in the result:
> ???????????For Each $Field In $Result.Fields
> ????????????Message($Field.Name)
> ???????????Next
>
> The problem occurs on the For Each line in that the Basic IDE displays
> an error at this point:
> Unknown field: txtMasterDatabase in FRMStart:41
>
> As I said above, the first field in the tuple is named
> txtMasterDatabase, so Gambas is at least seeing it. Why is it telling me
> the field is unknown?
>
> Thanks for any help and Happy New Year,
> Doug
>
>
Can you send me a SQL dump of that table?
--
Beno?t Minisini
From mb at code-it.com Fri Jan 5 14:34:49 2018
From: mb at code-it.com (mikeB)
Date: Fri, 5 Jan 2018 06:34:49 -0700
Subject: [Gambas-user] Web Cam preview and capture
In-Reply-To:
References: <43ffc9f8-9079-1e61-e619-5579b1102ed9@code-it.com>
Message-ID:
eGreetings,
At first glance it doesn't look like any of these examples preview what
is being recorded but I'll spend some more time look'n them over and
doing some testing with the code.
Thank you for your time and effort in responding to my quest.
mikeB
On 01/05/2018 01:32 AM, Gianluigi wrote:
> I do not know if these lessons can help you:
>
> http://www.gambas-it.org/wiki/index.php?title=Effettuare_una_ripresa_video_mediante_una_WebCam_con_il_Componente_gb.media
>
> http://www.gambas-it.org/wiki/index.php?title=Salvare_in_un_file_OGV_una_ripresa_video_mediante_una_WebCam_con_il_Componente_gb.media
>
> http://www.gambas-it.org/wiki/index.php?title=Salvare_in_un_file_MKV_una_ripresa_video_mediante_una_WebCam_con_il_Componente_gb.media
>
> http://www.gambas-it.org/wiki/index.php?title=Catturare_video_e_audio_con_una_webcam_ed_un_microfono_e_salvarli_in_un_unico_file_video_mediante_le_funzioni_esterne_del_API_di_VLC
>
> http://www.gambas-it.org/wiki/index.php?title=Catturare_e_riprodurre_immagini_video_mediante_una_WebCam_con_le_funzioni_esterne_delle_API_di_GStreamer
>
> http://www.gambas-it.org/wiki/index.php?title=Salvare_in_un_file_video_mediante_le_funzioni_esterne_del_API_di_GStreamer_la_ripresa_video_effettuata_con_una_WebCam
>
> http://www.gambas-it.org/wiki/index.php?title=Catturare_e_riprodurre_immagini_video_mediante_una_WebCam_con_le_funzioni_esterne_delle_API_di_VLC
>
> Regards
> Gianluigi
>
> 2018-01-04 22:41 GMT+01:00 mikeB :
>
>> eGreetings Gambas World,
>>
>> Would anyone out there happen to have a code snippet or simple
>> Gambas project that reviews/ displays the web cam input and records
>> video with sound - that you're willing to share?
>>
>> I know how to record using ffmpeg but can not find a way to review/
>> display what it's recording. Also, have spent days looking at the code
>> of "MediaPlayer" from the Gambas farm - it's completely above my head
>> ;-(
>>
>> A BIG THANKS for your consideration,
>> mikeB
>>
>> --------------------------------------------------
>>
>> This is the Gambas Mailing List
>> https://lists.gambas-basic.org/listinfo/user
>>
>> Hosted by https://www.hostsharing.net
>>
>
>
>
>
> --------------------------------------------------
>
> This is the Gambas Mailing List
> https://lists.gambas-basic.org/listinfo/user
>
> Hosted by https://www.hostsharing.net
>
From g4mba5 at gmail.com Fri Jan 5 14:57:14 2018
From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=)
Date: Fri, 5 Jan 2018 14:57:14 +0100
Subject: [Gambas-user] Web Cam preview and capture
In-Reply-To: <43ffc9f8-9079-1e61-e619-5579b1102ed9@code-it.com>
References: <43ffc9f8-9079-1e61-e619-5579b1102ed9@code-it.com>
Message-ID:
Le 04/01/2018 ? 22:41, mikeB a ?crit?:
> eGreetings Gambas World,
>
> Would anyone out there happen to have a code snippet or simple
> Gambas project that reviews/ displays the web cam input and records
> video with sound - that you're willing to share?
>
> I know how to record using ffmpeg but can not find a way to review/
> display what it's recording. Also, have spent days looking at the code
> of "MediaPlayer" from the Gambas farm - it's completely above my head
> ;-(
>
> A BIG THANKS for your consideration,
> mikeB
>
You should use the gb.media component, which is an almost direct
interface to GStreamer.
So if you find how to do what you want with GStreamer, doing the same
thing with Gambas should be just a matter of translation between
GStreamer names and its Gambas equivalents.
Regards,
--
Beno?t Minisini
From mb at code-it.com Fri Jan 5 15:42:26 2018
From: mb at code-it.com (mikeB)
Date: Fri, 5 Jan 2018 07:42:26 -0700
Subject: [Gambas-user] Web Cam preview and capture
In-Reply-To:
References: <43ffc9f8-9079-1e61-e619-5579b1102ed9@code-it.com>
Message-ID:
Thank you Sir - I'll spend my time hack'n the "GStreamer" -
as I know it can be done but just don't understand how at
the moment:-)
Have a GREAT day,
mikeB
On 01/05/2018 06:57 AM, Beno?t Minisini wrote:
> Le 04/01/2018 ? 22:41, mikeB a ?crit?:
>> eGreetings Gambas World,
>>
>> Would anyone out there happen to have a code snippet or simple
>> Gambas project that reviews/ displays the web cam input and records
>> video with sound - that you're willing to share?
>>
>> I know how to record using ffmpeg but can not find a way to review/
>> display what it's recording. Also, have spent days looking at the code
>> of "MediaPlayer" from the Gambas farm - it's completely above my head
>> ;-(
>>
>> A BIG THANKS for your consideration,
>> mikeB
>>
>
> You should use the gb.media component, which is an almost direct
> interface to GStreamer.
>
> So if you find how to do what you want with GStreamer, doing the same
> thing with Gambas should be just a matter of translation between
> GStreamer names and its Gambas equivalents.
>
> Regards,
>
From owlbrudder at gmail.com Sat Jan 6 04:31:15 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Sat, 06 Jan 2018 13:31:15 +1000
Subject: [Gambas-user] Extracting fields from a Result
In-Reply-To: <682dfc0f-136a-f7c7-8b0c-d32043a6e939@gmail.com>
References: <1514684664.12546.82.camel@gmail.com>
<682dfc0f-136a-f7c7-8b0c-d32043a6e939@gmail.com>
Message-ID: <1515209475.4277.62.camel@gmail.com>
On Fri, 2018-01-05 at 14:23 +0100, Beno?t Minisini wrote:
> Le 31/12/2017 ? 02:44, Doug Hutcheson a ?crit :
> > Hi everyone.
> >
> > I have successfully connected to my PostgreSQL database and the
> > field
> > count in the Result from my query is correct, but all my attempts
> > to
> > extract data from the fields have failed. I am cobbling together
> > code
> > from the wiki and from other posts here, but I am still missing
> > something.
> >
> > The table I am reading from has exactly one row and 35 fields. The
> > first
> > field is named txtMasterDatabase.
> >
> > My code declares a Field and a Result as follows:
> > Dim $Field As ResultField
> > Dim $Result As Result
> >
> > The query works correctly:
> > $Query = "Select * From abpa.tblParameters"
> > $Result = $Con.Exec($Query)
> >
> > The field count is correct - 35:
> > Message("Fields count = " & $Result.Fields.Count)
> >
> > Now I try to loop through the fields in the result:
> > For Each $Field In $Result.Fields
> > Message($Field.Name)
> > Next
> >
> > The problem occurs on the For Each line in that the Basic IDE
> > displays
> > an error at this point:
> > Unknown field: txtMasterDatabase in FRMStart:41
> >
> > As I said above, the first field in the tuple is named
> > txtMasterDatabase, so Gambas is at least seeing it. Why is it
> > telling me
> > the field is unknown?
> >
> > Thanks for any help and Happy New Year,
> > Doug
> >
> >
>
>
> Can you send me a SQL dump of that table?
>
Hi Beno?t.
I have attached the dump of that table and the test harness I used to
try to read it. I hope these are useful.
Kind regards,
Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tblparameters.sql
Type: application/sql
Size: 2214 bytes
Desc: not available
URL:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PostgreSQL_test-0.0.1.tar.gz
Type: application/x-compressed-tar
Size: 12506 bytes
Desc: not available
URL:
From owlbrudder at gmail.com Sat Jan 6 09:27:21 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Sat, 06 Jan 2018 18:27:21 +1000
Subject: [Gambas-user] Errors using DataBrowser control
Message-ID: <1515227241.4277.83.camel@gmail.com>
Hi everyone.
I am having difficulty with my DataBrowser on a PostgreSQL table. I
have attached the source of my mini project, an SQL dump of the table,
and two images showing the error when I click the delete button and
when I click the save button. In both cases it is complaining about a
null object, but I cannot work out which object this refers to. I was
able to add the record "Fungusbungle" using the DataBrowser, but now I
can't use the same control to get rid of it again.
I am sure it is my lack of understanding which is causing these
problems. Any help would be appreciated.
Thanks everyone for the great help in getting me up and running with
the Connection object.
Kind regards,
Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Delete error.png
Type: image/png
Size: 21590 bytes
Desc: not available
URL:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Save error.png
Type: image/png
Size: 20929 bytes
Desc: not available
URL:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PostgreSQL_test-0.0.1-2.tar.gz
Type: application/x-compressed-tar
Size: 49591 bytes
Desc: not available
URL:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tblparameters2.sql
Type: application/sql
Size: 18315 bytes
Desc: not available
URL:
From g4mba5 at gmail.com Sat Jan 6 10:08:51 2018
From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=)
Date: Sat, 6 Jan 2018 10:08:51 +0100
Subject: [Gambas-user] Errors using DataBrowser control
In-Reply-To: <1515227241.4277.83.camel@gmail.com>
References: <1515227241.4277.83.camel@gmail.com>
Message-ID:
Le 06/01/2018 ? 09:27, Doug Hutcheson a ?crit?:
> Hi everyone.
>
> I am having difficulty with my DataBrowser on a PostgreSQL table. I have
> attached the source of my mini project, an SQL dump of the table, and
> two images showing the error when I click the delete button and when I
> click the save button. In both cases it is complaining about a null
> object, but I cannot work out which object this refers to. I was able to
> add the record "Fungusbungle" using the DataBrowser, but now I can't use
> the same control to get rid of it again.
>
> I am sure it is my lack of understanding which is causing these
> problems. Any help would be appreciated.
>
> Thanks everyone for the great help in getting me up and running with the
> Connection object.
>
> Kind regards,
> Doug
>
How did you create the 'tblparameters2.sql' file? It is not a text file.
--
Beno?t Minisini
From patrik at trixon.se Sat Jan 6 10:54:34 2018
From: patrik at trixon.se (Patrik Karlsson)
Date: Sat, 6 Jan 2018 10:54:34 +0100
Subject: [Gambas-user] Loading Picture/Image from String/Byte[] data
Message-ID:
Hi there!
I have been away from Gambas for a while but now I'm looking into a gambas
client to a java server.
The goal is to restore a binary file (image) which is base64 encoded and
serialized to json.
I can load the image in the Gambas Client if I first store the file content
and load it as usual,
but I would like to avoid generating a temp file and read it directly since
I already have its content loaded.
Is it possible to load a Picture/Image from String/Byte[] data that
represents a file?
Option 1 below works, but I would like to use something that does not
include generating a file.
Option 2 is me poking around without any success.
Public Sub Button1_Click()
Dim javaGeneratedBase64EncodedImageFile As String
Dim decodedBase64 As String
Dim tempImagePath As String = Temp()
Dim fileByteArray As Byte[]
Dim i As Integer
Dim p As Pointer
Dim hFile As File
javaGeneratedBase64EncodedImageFile = File.Load("/home/pata/base64.txt")
decodedBase64 = UnBase64(javaGeneratedBase64EncodedImageFile)
fileByteArray = Byte[].FromString(decodedBase64)
Print tempImagePath
' option 1
File.Save(tempImagePath, decodedBase64)
PictureBox1.Picture = Picture.Load(tempImagePath)
' option 2
p = VarPtr(decodedBase64)
hFile = Open Memory p For Read
Close #hFile
' end of option 2
For i = 0 To fileByteArray.Length - 1
'Print fileByteArray[i]
Next
Print fileByteArray.Length
Print Now
End
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From g4mba5 at gmail.com Sat Jan 6 12:55:20 2018
From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=)
Date: Sat, 6 Jan 2018 12:55:20 +0100
Subject: [Gambas-user] Loading Picture/Image from String/Byte[] data
In-Reply-To:
References:
Message-ID: <5ae477b7-98be-ef14-621e-fa1a456f3334@gmail.com>
Le 06/01/2018 ? 10:54, Patrik Karlsson a ?crit?:
> Hi there!
>
> I have been away from Gambas for a while but now I'm looking into a
> gambas client to a java server.
> The goal is to restore a binary file (image) which is base64 encoded and
> serialized to json.
>
> I can load the image in the Gambas Client if I first store the file
> content and load it as usual,
> but I would like to avoid generating a temp file and read it directly
> since I already have its content loaded.
>
> Is it possible to load a Picture/Image from String/Byte[] data that
> represents a file?
>
> Option 1 below works, but I would like to use something that does not
> include generating a file.
> Option 2 is me poking around without any success.
>
> Public Sub Button1_Click()
>
> ? Dim javaGeneratedBase64EncodedImageFile As String
> ? Dim decodedBase64 As String
> ? Dim tempImagePath As String = Temp()
> ? Dim fileByteArray As Byte[]
> ? Dim i As Integer
> ? Dim p As Pointer
> ? Dim hFile As File
>
> ? javaGeneratedBase64EncodedImageFile = File.Load("/home/pata/base64.txt")
> ? decodedBase64 = UnBase64(javaGeneratedBase64EncodedImageFile)
> ? fileByteArray = Byte[].FromString(decodedBase64)
> ? Print tempImagePath
> ? ' option 1
> ? File.Save(tempImagePath, decodedBase64)
> ? PictureBox1.Picture = Picture.Load(tempImagePath)
>
> ? ' option 2
> ? p = VarPtr(decodedBase64)
> ? hFile = Open Memory p For Read
>
> ? Close #hFile
> ? ' end of option 2
>
> ? For i = 0 To fileByteArray.Length - 1
> ? ? 'Print fileByteArray[i]
> ? Next
>
> ? Print fileByteArray.Length
> ? Print Now
>
> End
>
I can add some methods to the Image and/or Picture class for that.
--
Beno?t Minisini
From bugtracker at gambaswiki.org Sat Jan 6 13:16:32 2018
From: bugtracker at gambaswiki.org (bugtracker at gambaswiki.org)
Date: Sat, 06 Jan 2018 12:16:32 GMT
Subject: [Gambas-user] [Gambas Bug Tracker] Bug #1222: Circles on maps
In-Reply-To:
References:
Message-ID:
http://gambaswiki.org/bugtracker/edit?object=BUG.1222&from=L21haW4-
Comment #4 by Carlo PANARA:
It seems that it works well!
Thank you Fabien!
From patrik at trixon.se Sat Jan 6 13:36:34 2018
From: patrik at trixon.se (Patrik Karlsson)
Date: Sat, 6 Jan 2018 13:36:34 +0100
Subject: [Gambas-user] Loading Picture/Image from String/Byte[] data
In-Reply-To: <5ae477b7-98be-ef14-621e-fa1a456f3334@gmail.com>
References:
<5ae477b7-98be-ef14-621e-fa1a456f3334@gmail.com>
Message-ID:
2018-01-06 12:55 GMT+01:00 Beno?t Minisini :
> Le 06/01/2018 ? 10:54, Patrik Karlsson a ?crit :
>
>> Hi there!
>>
>> I have been away from Gambas for a while but now I'm looking into a
>> gambas client to a java server.
>> The goal is to restore a binary file (image) which is base64 encoded and
>> serialized to json.
>>
>> I can load the image in the Gambas Client if I first store the file
>> content and load it as usual,
>> but I would like to avoid generating a temp file and read it directly
>> since I already have its content loaded.
>>
>> Is it possible to load a Picture/Image from String/Byte[] data that
>> represents a file?
>>
>> Option 1 below works, but I would like to use something that does not
>> include generating a file.
>> Option 2 is me poking around without any success.
>>
>> Public Sub Button1_Click()
>>
>> Dim javaGeneratedBase64EncodedImageFile As String
>> Dim decodedBase64 As String
>> Dim tempImagePath As String = Temp()
>> Dim fileByteArray As Byte[]
>> Dim i As Integer
>> Dim p As Pointer
>> Dim hFile As File
>>
>> javaGeneratedBase64EncodedImageFile = File.Load("/home/pata/base64.t
>> xt")
>> decodedBase64 = UnBase64(javaGeneratedBase64EncodedImageFile)
>> fileByteArray = Byte[].FromString(decodedBase64)
>> Print tempImagePath
>> ' option 1
>> File.Save(tempImagePath, decodedBase64)
>> PictureBox1.Picture = Picture.Load(tempImagePath)
>>
>> ' option 2
>> p = VarPtr(decodedBase64)
>> hFile = Open Memory p For Read
>>
>> Close #hFile
>> ' end of option 2
>>
>> For i = 0 To fileByteArray.Length - 1
>> 'Print fileByteArray[i]
>> Next
>>
>> Print fileByteArray.Length
>> Print Now
>>
>> End
>>
>>
> I can add some methods to the Image and/or Picture class for that.
>
> --
> Beno?t Minisini
>
That would be great! I'll stick to using a temp file until its done.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From bugtracker at gambaswiki.org Sat Jan 6 14:13:21 2018
From: bugtracker at gambaswiki.org (bugtracker at gambaswiki.org)
Date: Sat, 06 Jan 2018 13:13:21 GMT
Subject: [Gambas-user] [Gambas Bug Tracker] Bug #1222: Circles on maps
In-Reply-To:
References:
Message-ID:
http://gambaswiki.org/bugtracker/edit?object=BUG.1222&from=L21haW4-
Comment #5 by Fabien BODARD:
So I close the issue :-) . Tel me if you need something else. The components are growing with user needs.
Fabien BODARD changed the state of the bug to: Fixed.
From g4mba5 at gmail.com Sat Jan 6 17:16:09 2018
From: g4mba5 at gmail.com (=?UTF-8?Q?Beno=c3=aet_Minisini?=)
Date: Sat, 6 Jan 2018 17:16:09 +0100
Subject: [Gambas-user] Loading Picture/Image from String/Byte[] data
In-Reply-To:
References:
<5ae477b7-98be-ef14-621e-fa1a456f3334@gmail.com>
Message-ID: <388c6c35-4ea7-4f7c-3c5c-2a8d72a9db7c@gmail.com>
Le 06/01/2018 ? 13:36, Patrik Karlsson a ?crit?:
>
>
> I can add some methods to the Image and/or Picture class for that.
>
> --
> Beno?t Minisini
>
>
> That would be great! I'll stick to using a temp file until its done.
>
Done in commit
https://gitlab.com/gambas/gambas/commit/066c25c7aa0adaf2e558d837ab64dc84079cb8c7.
Regards,
--
Beno?t Minisini
From owlbrudder at gmail.com Sun Jan 7 05:25:09 2018
From: owlbrudder at gmail.com (Doug Hutcheson)
Date: Sun, 07 Jan 2018 14:25:09 +1000
Subject: [Gambas-user] Errors using DataBrowser control
In-Reply-To:
References: <1515227241.4277.83.camel@gmail.com>
Message-ID: <1515299109.4277.85.camel@gmail.com>
On Sat, 2018-01-06 at 10:08 +0100, Beno?t Minisini wrote:
> Le 06/01/2018 ? 09:27, Doug Hutcheson a ?crit :
> > Hi everyone.
> >
> > I am having difficulty with my DataBrowser on a PostgreSQL table. I
> > have
> > attached the source of my mini project, an SQL dump of the table,
> > and
> > two images showing the error when I click the delete button and
> > when I
> > click the save button. In both cases it is complaining about a
> > null
> > object, but I cannot work out which object this refers to. I was
> > able to
> > add the record "Fungusbungle" using the DataBrowser, but now I
> > can't use
> > the same control to get rid of it again.
> >
> > I am sure it is my lack of understanding which is causing these
> > problems. Any help would be appreciated.
> >
> > Thanks everyone for the great help in getting me up and running
> > with the
> > Connection object.
> >
> > Kind regards,
> > Doug
> >
>
> How did you create the 'tblparameters2.sql' file? It is not a text
> file.
>
>
Finger fumble when creating it. Here is the version I meant to provide.
Sorry,
Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tblparameters2.sql
Type: application/sql
Size: 18693 bytes
Desc: not available
URL:
From patrik at trixon.se Sun Jan 7 07:25:49 2018
From: patrik at trixon.se (Patrik Karlsson)
Date: Sun, 7 Jan 2018 07:25:49 +0100
Subject: [Gambas-user] Problem building from source. Due to changes in SDL?
Message-ID:
I was interested in testing the new image loading functions so I tried to
build from git, and stable release. It failed.
I found something about changes in SDL mixer,
https://hg.libsdl.org/SDL_mixer/diff/92882ef2ab81/SDL_mixer.h
1.5
typedef enum 1.6
{ 1.7
- MIX_INIT_FLAC = 0x00000001, 1.8
-
MIX_INIT_MOD = 0x00000002, 1.9
-
MIX_INIT_MODPLUG = 0x00000004, 1.10
- MIX_INIT_MP3 = 0x00000008, 1.11
- MIX_INIT_OGG = 0x00000010, 1.12
- MIX_INIT_FLUIDSYNTH = 0x00000020 1.13
+ MIX_INIT_FLAC = 0x00000001, 1.14
+ MIX_INIT_MOD = 0x00000002, 1.15
+ MIX_INIT_MP3 = 0x00000008, 1.16
+ MIX_INIT_OGG = 0x00000010, 1.17
+ MIX_INIT_MID = 0x00000020, 1.18
} MIX_InitFlags;
I'm using SDL Mixer 2.0.2 on Netrunner (arch).
Do I have to downgrade SDL or will Gambas be updated?
Making all in audio
make[5]: Entering directory
'/home/pata/src/gambas3-3.10.0/gb.sdl2/src/audio'
CC gb_sdl2_audio_la-c_sound.lo
CC gb_sdl2_audio_la-c_music.lo
CC gb_sdl2_audio_la-c_channel.lo
CC gb_sdl2_audio_la-main.lo
main.c: In function 'AUDIO_init':
main.c:61:13: error: 'MIX_INIT_FLUIDSYNTH' undeclared (first use in this
function); did you mean 'MIX_INIT_MID'?
init_mixer(MIX_INIT_FLUIDSYNTH, "FLUIDSYNTH");
^~~~~~~~~~~~~~~~~~~
MIX_INIT_MID
main.c:61:13: note: each undeclared identifier is reported only once for
each function it appears in
make[5]: *** [Makefile:514: gb_sdl2_audio_la-main.lo] Error 1
make[5]: Leaving directory '/home/pata/src/gambas3-3.10.0/gb.sdl2/src/audio'
make[4]: *** [Makefile:678: all-recursive] Error 1
make[4]: Leaving directory '/home/pata/src/gambas3-3.10.0/gb.sdl2/src'
make[3]: *** [Makefile:437: all-recursive] Error 1
make[3]: Leaving directory '/home/pata/src/gambas3-3.10.0/gb.sdl2'
make[2]: *** [Makefile:369: all] Error 2
make[2]: Leaving directory '/home/pata/src/gambas3-3.10.0/gb.sdl2'
make[1]: *** [Makefile:438: all-recursive] Error 1
make[1]: Leaving directory '/home/pata/src/gambas3-3.10.0'
make: *** [Makefile:379: all] Error 2
[pata at xps gambas3-3.10.0]$
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From patrik at trixon.se Sun Jan 7 08:04:44 2018
From: patrik at trixon.se (Patrik Karlsson)
Date: Sun, 7 Jan 2018 08:04:44 +0100
Subject: [Gambas-user] Loading Picture/Image from String/Byte[] data
In-Reply-To: <388c6c35-4ea7-4f7c-3c5c-2a8d72a9db7c@gmail.com>
References:
<5ae477b7-98be-ef14-621e-fa1a456f3334@gmail.com>
<388c6c35-4ea7-4f7c-3c5c-2a8d72a9db7c@gmail.com>
Message-ID:
Hey, It works! :)
Thank you!
Public Sub loadButton_Click()
PictureBox1.Picture = Picture.FromString(UnBase64(
File.Load("/home/pata/base64.txt")))
Print Now
End
2018-01-06 17:16 GMT+01:00 Beno?t Minisini :
> Le 06/01/2018 ? 13:36, Patrik Karlsson a ?crit :
>
>>
>>
>> I can add some methods to the Image and/or Picture class for that.
>>
>> -- Beno?t Minisini
>>
>>
>> That would be great! I'll stick to using a temp file until its done.
>>
>>
> Done in commit https://gitlab.com/gambas/gamb
> as/commit/066c25c7aa0adaf2e558d837ab64dc84079cb8c7.
>
> Regards,
>
> --
> Beno?t Minisini
>
> --------------------------------------------------
>
> This is the Gambas Mailing List
> https://lists.gambas-basic.org/listinfo/user
>
> Hosted by https://www.hostsharing.net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From patrik at trixon.se Sun Jan 7 08:06:06 2018
From: patrik at trixon.se (Patrik Karlsson)
Date: Sun, 7 Jan 2018 08:06:06 +0100
Subject: [Gambas-user] Problem building from source. Due to changes in
SDL?
In-Reply-To:
References:
Message-ID:
2018-01-07 7:25 GMT+01:00 Patrik Karlsson :
> I was interested in testing the new image loading functions so I tried to
> build from git, and stable release. It failed.
>
> I found something about changes in SDL mixer, https://hg.libsdl.org/
> SDL_mixer/diff/92882ef2ab81/SDL_mixer.h
>
> 1.5 typedef enum 1.6 { 1.7 - MIX_INIT_FLAC = 0x00000001, 1.8 - MIX_INIT_MOD = 0x00000002, 1.9 - MIX_INIT_MODPLUG = 0x00000004, 1.10 - MIX_INIT_MP3 = 0x00000008, 1.11 - MIX_INIT_OGG = 0x00000010, 1.12 - MIX_INIT_FLUIDSYNTH = 0x00000020 1.13 + MIX_INIT_FLAC = 0x00000001, 1.14 + MIX_INIT_MOD = 0x00000002, 1.15 + MIX_INIT_MP3 = 0x00000008, 1.16 + MIX_INIT_OGG = 0x00000010, 1.17 + MIX_INIT_MID = 0x00000020, 1.18