[Gambas-user] Looking up data from a second table

T Lee Davidson t.lee.davidson at gmail.com
Tue Feb 20 00:03:38 CET 2018


On 02/19/2018 05:59 PM, Christof Thalhofer wrote:
> Am 19.02.2018 um 23:19 schrieb bkv at mailbox.org:
>> Chrisof
> 
> You are better than Piccoro ;-)
> 
>> I tried to enter the sql select statement into the Table property of the
>> Datasource as suggested. Gambas will let me write text into this
>> property only if I let the Connection property be blank. In that case 
>> calling the MoveFirst method fails. Something is not right.
>>
>> I also created the view in the sqlite3 console, but the view does not
>> show up in Gambas, so I wasn't able to use it.
>>
>> Please remember that the main purpose of this form is to maintain the
>> /patron/ record. I need the field from /krutt/ only as additional
>> information displayed.
> 
> I am not familiar with the gb.db.form component. But in theory the
> connection to a db is created once and then can be used for a lot of
> different sql statements.
> 
> This is the way I do it in my db programming all the time. For that I
> have created my own components.
> 
> But when I look at the components in gb.db.form I see in the help of
> DataView:
> 
> ----8<----------------------------------------------------------------
> DataSource.Connection (gb.db.form)
> 
> Property Connection As Connection
> 
> Return or set the Connection that will be used by the DataSource
> control. If no connection is set, the DataSource will use the default
> connection.
> ----8<----------------------------------------------------------------
> 
> So I think you should try to set up a default connection ... ?
> 

I think the DataSource should be set programatically. Setting the Connection properties via the IDE seems to have some issues.


-- 
Lee


More information about the User mailing list