SalListPopulate with Oracle: Tab positions

General discussion forum about all databases other than SqlBase.
Northdoor

SalListPopulate with Oracle: Tab positions

Post by Northdoor » 05 Aug 2011, 10:54

I have encountered a problem using SQLWindows 5.2 SP3. I am using the function SalListPopulate to populate a List Box using a SQL query that selects two columns from an Oracle 10 database. The data is not displayed correctly - the data from the second column is far to the right. The behaviour is different if I use SQLBase. It is also different if I use SalListAdd to add two string values that are separated by a tab character. It seems that the tab positions for the List Box are being set incorrectly when the data is coming from Oracle. I have attached a small application to demonstrate the behaviour - the Oracle database name, user name and password will need to be modified.
You do not have the required permissions to view the files attached to this post.

Jeff Luther

Re: SalListPopulate with Oracle: Tab positions

Post by Jeff Luther » 05 Aug 2011, 23:52

It seems that the tab positions for the List Box are being set incorrectly when the data is coming from Oracle.
I don't think the listbox, per se, knows about Oracle and how to set its tab positions. It seems as if Oracle might be setting "COLUMNx" to a fixed width by padding spaces (?) to the end of the value before returning. If that string coming back is"

Code: Select all

 "COLUMNx    "
or example, that would account for it.

I see the same thing if the Oracle query is: "SELECT dummy, dummy FROM DUAL"
That is, I get X with lots of spaces and another X.

One other way to test, is do SalListPopulate the 'long way' - something like:

Code: Select all

SqlPrepareAndExecute
While SqlFetchNext into 2 string vars
    SalListAdd( hWndListBox, s1 || sTabChar|| s2 )
and query a real DB table with know-length values for 2 strings. I grant you it's a strange one, but I'd suggest testing further if this is an issue for you to help narrow down what's really going on.

Northdoor

Re: SalListPopulate with Oracle: Tab positions

Post by Northdoor » 08 Aug 2011, 13:16

Thank you for your response. There is no issue with the tab stops in TD4.2. Can you please explain why I am seeing this behaviour with TD5.2 SP3 but not with TD4.2? Thank you.

ivanlun

Re: SalListPopulate with Oracle: Tab positions

Post by ivanlun » 11 Dec 2013, 08:54

Hello,

have the same problem also on TD 6.0 SP8.

Workaround: Calculate tab stop positions for count of columns and call manually SalListSetTabs every time after populating the list box :(

Hope there will be a solution in future TD versions!

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests