[Gambas-user] Forbid DataSource to fetch certain fields

Benoît Minisini gambas at ...1...
Sat Sep 29 19:10:19 CEST 2012


Le 29/09/2012 19:07, Tobias Boege a écrit :
> On Sat, 29 Sep 2012, Beno?t Minisini wrote:
>> Le 29/09/2012 09:44, Tobias Boege a ?crit :
>>> On Sat, 29 Sep 2012, Tobias Boege wrote:
>>>> Hi,
>>>>
>>>> rocko's recent question brought me back to a problem I once had:
>>>> We have a database at school which contains a lot of big blobs (PDFs of
>>>> student papers). It consequently takes an unneccessary amount of time to
>>>> load all the records in there. My question is hence: Can I tell the DataView
>>>
>>> read the last word as: DataSource ;-)
>>>
>>>> to only load certain fields from the database table? I think of some
>>>> DataSource.Columns property that does:
>>>>
>>>> sReq = "SELECT " & DataSource.Columns.Join() & " FROM " & ...
>>>>
>>>> I saw something similar in the DataTable.class source code but I couldn't
>>>> figure out how to get the $aKey there modified. I think you'll know better.
>>>>
>>>> Can someone please point me in the right direction?
>>>>
>>>> Regards,
>>>> Tobi
>>>
>>
>> DataSource can take a SQL request instead of a table. But then you
>> cannot modify the records.
>>
>> --
>> Beno?t Minisini
>
> Bruce, clever idea. That's certainly feasible but a workaround.
> Benoit, is there any reason there is no such DataSource.Columns As String[]?
>
> Regards,
> Tobi
>

Because using your own SQL request is more powerful.

-- 
Benoît Minisini




More information about the User mailing list