[Gambas-user] Extracting fields from a Result

Doug Hutcheson owlbrudder at gmail.com
Wed Jan 3 02:26:44 CET 2018



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 = `<my
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: <http://lists.gambas-basic.org/pipermail/user/attachments/20180103/f778bae4/attachment-0001.html>


More information about the User mailing list