[Gambas-user] Password problem in database connection

Doug Hutcheson owlbrudder at gmail.com
Fri Jan 5 02:05:19 CET 2018



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.


More information about the User mailing list