[Gambas-user] DataSource Sort Problem

Ernest Wilson gambasml at junkheaven.com
Fri Jul 20 15:04:45 CEST 2018


I have attached a sample project that demonstrates the problem.

The project I am developing has some additional fields in the table,
including a boolean field that indicates the tax status of the process
record (True is taxable, False in not taxable). The boolean field is
represented on the Form by a DataCheckbox.

As I was building the test project, I realized that the code in my
previous email works correctly if the DataCheckbox is removed from the Form.

Regards,
Ernest Wilson

On 07/19/2018 09:39 AM, Benoît Minisini wrote:
> Le 19/07/2018 à 16:00, Ernest Wilson a écrit :
>> Hello,
>>
>> I'm using Gambas 3.11.2 and have an error with the Sort property of 
>> the DataSource.
>>
>> The DataSource on my Form connects to an SQLite Table consisting of 
>> fields "ProcessID" and "ProcessTitle". The records are displayed in a 
>> DataBrowser which functions properly.
>>
>> I would like to have records displayed in order by the "ProcessTitle" 
>> field, so I have used the following code to initialize the DataSource 
>> when opening the Form:
>>
>>    With DataSource1
>>      .Connection = Connection5
>>      .Table = "Processes"
>>      .Sort = "ProcessTitle"
>>    End With
>>
>> The sort works properly when records are displayed, however, an error 
>> dialog displaying the message "Invalid value" is presented before the 
>> form opens. Clicking the OK response to the error dialog allows the 
>> window to open and everything functions normally.
>>
>> If I comment out the line with .Sort = "ProcessTitle", the error does 
>> not occur, but of course, there is no sort.
>>
>> Any ideas about how to fix this, will be much appreciated.
>>
>
> If you can provide a little project (with a little database) that 
> reproduces the bug, it would be great.
>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: Data_Sort_Test.zip
Type: application/zip
Size: 23370 bytes
Desc: not available
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180720/c9a2bbc7/attachment-0001.zip>


More information about the User mailing list